public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end.
@ 2011-06-27 18:27 dougkwan at google dot com
  2011-06-27 20:48 ` [Bug c/49551] " dougkwan at google dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dougkwan at google dot com @ 2011-06-27 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: common variables and -fdata-sections cause ICE in C
                    front-end.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dougkwan@google.com


The following 2 line cause both gcc-4.6.0 and trunk to crash:

---bug.c---
int x = 1;
int x;
---
$ arm-unknown-linux-gnueabi-gcc -O -fdata-sections bug.c
bug.c:2:1: internal compiler error: in get_variable_section, at varasm.c:1004
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ arm-unknown-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=install/bin/arm-unknown-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/local/google2/home/dougkwan/gcc-trunk-1/install/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.7.0/lto-wrapper
Target: arm-unknown-linux-gnueabi
Configured with: ../gcc/configure --target=arm-unknown-linux-gnueabi
--disable-bootstrap --enable-languages=c --with-gmp=/home/dougkwan/gcc-lib
--with-sysroot=/home/dougkwan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root
Thread model: posix
gcc version 4.7.0 20110607 (experimental) (GCC)


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

* [Bug c/49551] common variables and -fdata-sections cause ICE in C front-end.
  2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
@ 2011-06-27 20:48 ` dougkwan at google dot com
  2014-09-24 17:58 ` [Bug target/49551] tentative declaration after definition " mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dougkwan at google dot com @ 2011-06-27 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Doug Kwan <dougkwan at google dot com> 2011-06-27 20:47:59 UTC ---
The variable x in the test case is should not be a common variable but the
DECL_COMMON is set after merging the first and the second declarations.  That
ultimately leads to an ICE.


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

* [Bug target/49551] tentative declaration after definition and -fdata-sections cause ICE in C front-end.
  2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
  2011-06-27 20:48 ` [Bug c/49551] " dougkwan at google dot com
@ 2014-09-24 17:58 ` mpolacek at gcc dot gnu.org
  2015-01-29 21:37 ` bilbotheelffriend at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-09-24 17:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49551

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
          Component|c                           |target

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Is this still an issue?


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

* [Bug target/49551] tentative declaration after definition and -fdata-sections cause ICE in C front-end.
  2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
  2011-06-27 20:48 ` [Bug c/49551] " dougkwan at google dot com
  2014-09-24 17:58 ` [Bug target/49551] tentative declaration after definition " mpolacek at gcc dot gnu.org
@ 2015-01-29 21:37 ` bilbotheelffriend at gmail dot com
  2015-06-02 16:43 ` prathamesh3492 at gcc dot gnu.org
  2015-06-02 16:46 ` prathamesh3492 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: bilbotheelffriend at gmail dot com @ 2015-01-29 21:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49551

Prathamesh <bilbotheelffriend at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bilbotheelffriend at gmail dot com

--- Comment #3 from Prathamesh <bilbotheelffriend at gmail dot com> ---
It appears the issue is still present on trunk for arm-none-linux-gnueabihf.
Compiling the above code gives following ICE:
(arm-none-linux-gnueabihf-gcc -O -fdata-sections):
fo.c:2:1: internal compiler error: in get_variable_section, at varasm.c:1151
 int x;
 ^
0xd1b9ab get_variable_section(tree_node*, bool)
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/varasm.c:1150
0xd1ca81 get_block_for_decl
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/varasm.c:1216
0xd1e50f make_decl_rtl(tree_node*)
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/varasm.c:1346
0x5301fc duplicate_decls
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-decl.c:2732
0x533400 pushdecl(tree_node*)
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-decl.c:2888
0x5457d6 start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-decl.c:4626
0x595d7e c_parser_declaration_or_fndef
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-parser.c:1846
0x5a07b8 c_parser_external_declaration
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-parser.c:1452
0x5a1215 c_parser_translation_unit
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-parser.c:1339
0x5a1215 c_parse_file()
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c/c-parser.c:15416
0x5fd622 c_common_parse_file()
   
/home/prathamesh.kulkarni/arm-gnu-toolchain/src/gcc.git~master/gcc/c-family/c-opts.c:1052

Thanks,
Prathamesh


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

* [Bug target/49551] tentative declaration after definition and -fdata-sections cause ICE in C front-end.
  2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
                   ` (2 preceding siblings ...)
  2015-01-29 21:37 ` bilbotheelffriend at gmail dot com
@ 2015-06-02 16:43 ` prathamesh3492 at gcc dot gnu.org
  2015-06-02 16:46 ` prathamesh3492 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2015-06-02 16:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49551

--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
Author: prathamesh3492
Date: Tue Jun  2 16:42:27 2015
New Revision: 224033

URL: https://gcc.gnu.org/viewcvs?rev=224033&root=gcc&view=rev
Log:
2015-06-02  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

        PR c/49551
        * c-decl.c (merge_decls): Merge DECL_COMMON.
        * gcc.dg/pr49551.c: New test-case.


Added:
    trunk/gcc/testsuite/gcc.dg/pr49551.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/49551] tentative declaration after definition and -fdata-sections cause ICE in C front-end.
  2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
                   ` (3 preceding siblings ...)
  2015-06-02 16:43 ` prathamesh3492 at gcc dot gnu.org
@ 2015-06-02 16:46 ` prathamesh3492 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2015-06-02 16:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49551

prathamesh3492 at gcc dot gnu.org changed:

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

--- Comment #6 from prathamesh3492 at gcc dot gnu.org ---
Fixed by r224033.


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

end of thread, other threads:[~2015-06-02 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 18:27 [Bug c/49551] New: common variables and -fdata-sections cause ICE in C front-end dougkwan at google dot com
2011-06-27 20:48 ` [Bug c/49551] " dougkwan at google dot com
2014-09-24 17:58 ` [Bug target/49551] tentative declaration after definition " mpolacek at gcc dot gnu.org
2015-01-29 21:37 ` bilbotheelffriend at gmail dot com
2015-06-02 16:43 ` prathamesh3492 at gcc dot gnu.org
2015-06-02 16:46 ` prathamesh3492 at gcc dot gnu.org

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).