public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31331]  New: ICE on invalid function attribute syntax for main()
@ 2007-03-23 21:16 eweddington at cso dot atmel dot com
  2007-04-12 15:32 ` [Bug c/31331] " j at uriah dot heep dot sax dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-03-23 21:16 UTC (permalink / raw)
  To: gcc-bugs

Program:
__attribute__ ((naked)) int main(void)
{
    return 0;
}

Compiled with 4.1.1 for the AVR target:

Compiling C: test.c
avr-gcc -c -mmcu=atmega128 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=./test.lst  -std=gnu99 -Wundef -MMD -MP -MF .dep/test.o.d test.c -o
test.o 
test.c:2: internal compiler error: in start_function, at c-decl.c:6014
Please submit a full bug report,


A program with the proper syntax, compiles without error:

int main(void) __attribute__ ((naked));

int main(void)
{
    return 0;
}


-- 
           Summary: ICE on invalid function attribute syntax for main()
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eweddington at cso dot atmel dot com
 GCC build triplet: mingw
  GCC host triplet: mingw
GCC target triplet: avr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/31331] ICE on invalid function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
@ 2007-04-12 15:32 ` j at uriah dot heep dot sax dot de
  2007-06-18 22:00 ` eweddington at cso dot atmel dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: j at uriah dot heep dot sax dot de @ 2007-04-12 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from j at uriah dot heep dot sax dot de  2007-04-12 16:32 -------
I disagree the "invalid syntax".  According to the formal attribute syntax
description:

``Any list of specifiers and qualifiers at the start of a declaration may
contain attribute specifiers, whether or not such a list may in that
context contain storage class specifiers.''

it is a perfectly valid use.  Syntactically, the ``int main(void)'' part of
that function definition is a declarator, so it essentially combines a
declaration with a definition.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/31331] ICE on invalid function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
  2007-04-12 15:32 ` [Bug c/31331] " j at uriah dot heep dot sax dot de
@ 2007-06-18 22:00 ` eweddington at cso dot atmel dot com
  2007-06-18 22:01 ` eweddington at cso dot atmel dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-18 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from eweddington at cso dot atmel dot com  2007-06-18 22:00 -------
Created an attachment (id=13733)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13733&action=view)
Patch to fix bug, written by Anatoly Sokolov


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/31331] ICE on invalid function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
  2007-04-12 15:32 ` [Bug c/31331] " j at uriah dot heep dot sax dot de
  2007-06-18 22:00 ` eweddington at cso dot atmel dot com
@ 2007-06-18 22:01 ` eweddington at cso dot atmel dot com
  2007-06-26 19:32 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-18 22:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from eweddington at cso dot atmel dot com  2007-06-18 22:01 -------
The attached patch, written by Anatoly Sokolov, fixes the bug.


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aesok at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-18 22:01:43
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/31331] ICE on invalid function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (2 preceding siblings ...)
  2007-06-18 22:01 ` eweddington at cso dot atmel dot com
@ 2007-06-26 19:32 ` pinskia at gcc dot gnu dot org
  2007-07-04 21:10 ` [Bug target/31331] [avr] ICE on " aesok at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-26 19:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-06-26 19:32 -------
*** Bug 32517 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simone_arrigo at yahoo dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/31331] [avr] ICE on function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (3 preceding siblings ...)
  2007-06-26 19:32 ` pinskia at gcc dot gnu dot org
@ 2007-07-04 21:10 ` aesok at gcc dot gnu dot org
  2007-07-07 19:31 ` aesok at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aesok at gcc dot gnu dot org @ 2007-07-04 21:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from aesok at gcc dot gnu dot org  2007-07-04 21:10 -------
Subject: Bug 31331

Author: aesok
Date: Wed Jul  4 21:10:28 2007
New Revision: 126337

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126337
Log:
        PR target/31331
        * config/avr/avr.c (avr_naked_function_p): Handle receiving a type
        rather than a decl. 
        (avr_attribute_table): Make "naked" attribute apply to function types
        rather than to decls.
        (avr_handle_fntype_attribute): New function.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/31331] [avr] ICE on function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (4 preceding siblings ...)
  2007-07-04 21:10 ` [Bug target/31331] [avr] ICE on " aesok at gcc dot gnu dot org
@ 2007-07-07 19:31 ` aesok at gcc dot gnu dot org
  2007-07-07 19:37 ` aesok at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aesok at gcc dot gnu dot org @ 2007-07-07 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from aesok at gcc dot gnu dot org  2007-07-07 19:30 -------
Subject: Bug 31331

Author: aesok
Date: Sat Jul  7 19:30:37 2007
New Revision: 126446

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126446
Log:
        PR target/31331
        * config/avr/avr.c (avr_naked_function_p): Handle receiving a type
        rather than a decl. 
        (avr_attribute_table): Make "naked" attribute apply to function types
        rather than to decls.
        (avr_handle_fntype_attribute): New function.


Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/config/avr/avr.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/31331] [avr] ICE on function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (5 preceding siblings ...)
  2007-07-07 19:31 ` aesok at gcc dot gnu dot org
@ 2007-07-07 19:37 ` aesok at gcc dot gnu dot org
  2007-07-07 19:39 ` aesok at gcc dot gnu dot org
  2007-07-08 14:35 ` eweddington at cso dot atmel dot com
  8 siblings, 0 replies; 10+ messages in thread
From: aesok at gcc dot gnu dot org @ 2007-07-07 19:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from aesok at gcc dot gnu dot org  2007-07-07 19:37 -------
Fixed.


-- 

aesok at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/31331] [avr] ICE on function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (6 preceding siblings ...)
  2007-07-07 19:37 ` aesok at gcc dot gnu dot org
@ 2007-07-07 19:39 ` aesok at gcc dot gnu dot org
  2007-07-08 14:35 ` eweddington at cso dot atmel dot com
  8 siblings, 0 replies; 10+ messages in thread
From: aesok at gcc dot gnu dot org @ 2007-07-07 19:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from aesok at gcc dot gnu dot org  2007-07-07 19:39 -------
Subject: Bug 31331

Author: aesok
Date: Sat Jul  7 19:39:36 2007
New Revision: 126447

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126447
Log:
        PR target/31331
        * config/avr/avr.c (avr_naked_function_p): Handle receiving a type
        rather than a decl. 
        (avr_attribute_table): Make "naked" attribute apply to function types
        rather than to decls.
        (avr_handle_fntype_attribute): New function.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/avr/avr.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/31331] [avr] ICE on function attribute syntax for main()
  2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
                   ` (7 preceding siblings ...)
  2007-07-07 19:39 ` aesok at gcc dot gnu dot org
@ 2007-07-08 14:35 ` eweddington at cso dot atmel dot com
  8 siblings, 0 replies; 10+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-07-08 14:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31331


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-08 14:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-23 21:16 [Bug c/31331] New: ICE on invalid function attribute syntax for main() eweddington at cso dot atmel dot com
2007-04-12 15:32 ` [Bug c/31331] " j at uriah dot heep dot sax dot de
2007-06-18 22:00 ` eweddington at cso dot atmel dot com
2007-06-18 22:01 ` eweddington at cso dot atmel dot com
2007-06-26 19:32 ` pinskia at gcc dot gnu dot org
2007-07-04 21:10 ` [Bug target/31331] [avr] ICE on " aesok at gcc dot gnu dot org
2007-07-07 19:31 ` aesok at gcc dot gnu dot org
2007-07-07 19:37 ` aesok at gcc dot gnu dot org
2007-07-07 19:39 ` aesok at gcc dot gnu dot org
2007-07-08 14:35 ` eweddington at cso dot atmel dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).