Issue Details (XML | Word | Printable)

Key: PCC-104
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Anders Magnusson
Reporter: Detlef Riekenberg
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

pcc failed to compile any binary (GCC_COMPAT mode enabled)

Created: 21/Nov/09 01:23 AM   Updated: 30/Mar/10 12:09 AM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File cgram.diff (0.7 kB)
2. File ctm_asm.M1JEsK (0.4 kB)
3. File nothrow-E.c (22 kB)
4. File redirect.c (0.4 kB)

Environment: ubuntu 8.04 / i386


 Description  « Hide
autoconf failed to build a binary with pcc (GCC_COMPAT mode enabled):
/usr/include//stdio.h, line 426: syntax error

extern int __REDIRECT (sscanf, (__const char *__restrict __s,
__const char *__restrict __format, ...),
__isoc99_sscanf) __THROW;


--
by by ... Detlef


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 31/Dec/09 02:11 PM
Please recheck if this is still true?

Detlef Riekenberg added a comment - 15/Jan/10 03:02 PM
autoconf still abort here.
The preprocessed output has an _attribute((__nothrow__)) at the End of failed Line.

--
By by ... Detlef



Anders Magnusson added a comment - 15/Jan/10 05:59 PM
Can you please send me the preprocessed file? ``it works for me''.

Detlef Riekenberg added a comment - 27/Jan/10 12:22 AM
It's likely the function redirection at asm level:
(The __REDIRECT macro)

The preprocessed example will follow

--
By by ... Detlef


Detlef Riekenberg added a comment - 27/Jan/10 12:38 AM
Failures:

nothrow-E.c, line 2394: syntax error
nothrow-E.c, line 2434: syntax error
nothrow-E.c, line 2437: syntax error
nothrow-E.c, line 2442: syntax error

--
by by ... Detlef


Detlef Riekenberg added a comment - 28/Feb/10 10:00 PM - edited
As already mentioned in the previous comment and visible in the attached file,
pcc failed on __asm__ redirection with "syntax error"

A stripped down example is attached.

On gcc, __USER_LABEL_PREFIX__ is a weak define to an empty string,
but that's not needed for this bug.

--
By by ... Detlef

Iain Hibbert added a comment - 10/Mar/10 08:14 PM
I think this may actually be the same issue as something I have been looking at, that ccom cannot handle __attribute__ after __asm__ in a function declaration, though its ok to have it before.. (gcc Attribute Syntax page does say that it should be supported)

void foo (int) __asm__("__foo") __attribute__((__noreturn__));

void foo (int arg)
{
}

I think I have worked out a fix to cgram.y.

Iain Hibbert added a comment - 10/Mar/10 08:15 PM
allow __attribute__ after __asm__ in a function declaration

I am no yacc expert, can this be checked?

Iain Hibbert added a comment - 10/Mar/10 08:21 PM - edited
Hi, if that was the correct fix, it may have bearing on http://pcc.ludd.ltu.se/jira/browse/PCC-118 also?

(guessing that __NORETURN is appended to the end of a function that is being redirected)

Anders Magnusson added a comment - 19/Mar/10 10:09 AM
Should be fixed now.

Detlef Riekenberg added a comment - 30/Mar/10 12:06 AM - edited
Still not fixed:
$ pcc redirect.c -o redirect_pcc
-> undefined reference to `main'

pcc use the __asm__ part and creates a function declaration for the following code (main)


The assembler code produced from attachment 4
(http://pcc.ludd.ltu.se/jira/secure/attachment/10085/redirect.c)
is attached as attachment 2
(http://pcc.ludd.ltu.se/jira/secure/attachment/10087/ctm_asm.M1JEsK).

--
By by ... Detlef