* [Bug middle-end/53790] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
@ 2012-06-27 21:18 ` samueldotj at gmail dot com
2012-06-27 21:20 ` pinskia at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: samueldotj at gmail dot com @ 2012-06-27 21:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #1 from Samuel Jacob <samueldotj at gmail dot com> 2012-06-27 21:18:03 UTC ---
Adding back trace just in case if it is needed..
(gdb) bt
#0 0x00000000005b999e in expand_expr_real_1 (exp=0x7ffff70b9580,
target=<optimized out>, tmode=VOIDmode, modifier=EXPAND_NORMAL,
alt_rtl=<optimized out>)
at ../.././gcc/expr.c:9187
#1 0x00000000005bb50d in expand_expr_real (alt_rtl=<optimized out>,
modifier=<optimized out>, tmode=<optimized out>, target=<optimized out>,
exp=0x7ffff70b9580)
at ../.././gcc/expr.c:7383
#2 expand_expr_real (exp=0x7ffff70b9580, target=<optimized out>,
tmode=<optimized out>, modifier=<optimized out>, alt_rtl=<optimized out>) at
../.././gcc/expr.c:7351
#3 0x00000000005b8e20 in expand_expr (modifier=EXPAND_NORMAL, mode=VOIDmode,
target=0x0, exp=<optimized out>) at ../.././gcc/expr.h:424
#4 expand_expr_real_1 (exp=0x7ffff70ba528, target=<optimized out>,
tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=<optimized out>) at
../.././gcc/expr.c:8992
#5 0x000000000070d4c3 in expand_expr (modifier=<optimized out>, mode=VOIDmode,
target=0x0, exp=0x7ffff70ba528) at ../.././gcc/expr.h:424
#6 expand_asm_operands (string=0x7ffff70bd168, outputs=<optimized out>,
inputs=<optimized out>, clobbers=0x7ffff70bd438, labels=0x0, vol=1, locus=1486)
at ../.././gcc/stmt.c:898
#7 0x000000000070e20a in expand_asm_stmt (stmt=<optimized out>) at
../.././gcc/stmt.c:1187
#8 0x0000000000531b68 in expand_gimple_stmt_1 (stmt=0x7ffff70a33c0) at
../.././gcc/cfgexpand.c:1922
#9 expand_gimple_stmt (stmt=0x7ffff70a33c0) at ../.././gcc/cfgexpand.c:2084
#10 0x0000000000532ca8 in expand_gimple_basic_block (bb=0x7ffff709a1a0) at
../.././gcc/cfgexpand.c:3626
#11 0x000000000053664e in gimple_expand_cfg () at ../.././gcc/cfgexpand.c:4109
#12 0x0000000000688ee9 in execute_one_pass (pass=0x1084cc0) at
../.././gcc/passes.c:1556
#13 0x0000000000689195 in execute_pass_list (pass=0x1084cc0) at
../.././gcc/passes.c:1611
#14 0x00000000007553c1 in tree_rest_of_compilation (fndecl=0x7ffff709c800) at
../.././gcc/tree-optimize.c:422
#15 0x00000000008955af in cgraph_expand_function (node=0x7ffff7e926e0) at
../.././gcc/cgraphunit.c:1576
#16 0x000000000089720a in cgraph_expand_all_functions () at
../.././gcc/cgraphunit.c:1635
#17 cgraph_optimize () at ../.././gcc/cgraphunit.c:1899
#18 0x000000000089760a in cgraph_finalize_compilation_unit () at
../.././gcc/cgraphunit.c:1096
#19 0x000000000049ffd5 in c_write_global_declarations () at
../.././gcc/c-decl.c:9878
#20 0x000000000071a1a8 in compile_file () at ../.././gcc/toplev.c:591
#21 do_compile () at ../.././gcc/toplev.c:1900
#22 toplev_main (argc=13, argv=0x7fffffffe318) at ../.././gcc/toplev.c:1963
#23 0x00007ffff71b1c4d in __libc_start_main () from /lib/libc.so.6
#24 0x000000000048f971 in _start ()
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
2012-06-27 21:18 ` [Bug middle-end/53790] " samueldotj at gmail dot com
@ 2012-06-27 21:20 ` pinskia at gcc dot gnu.org
2012-06-27 21:25 ` samueldotj at gmail dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-06-27 21:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-06-27 21:19:47 UTC ---
I think this could should be rejected as "extern u_t extern_var;" is declaring
a variable with an unknown size.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
2012-06-27 21:18 ` [Bug middle-end/53790] " samueldotj at gmail dot com
2012-06-27 21:20 ` pinskia at gcc dot gnu.org
@ 2012-06-27 21:25 ` samueldotj at gmail dot com
2012-06-27 21:31 ` samueldotj at gmail dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: samueldotj at gmail dot com @ 2012-06-27 21:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
Samuel Jacob <samueldotj at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.5.3
--- Comment #3 from Samuel Jacob <samueldotj at gmail dot com> 2012-06-27 21:25:43 UTC ---
(In reply to comment #2)
> I think this could should be rejected as "extern u_t extern_var;" is declaring
> a variable with an unknown size.
I dont understand can you please elaborate - Why declaring a variable of
unknown size is problematic?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (2 preceding siblings ...)
2012-06-27 21:25 ` samueldotj at gmail dot com
@ 2012-06-27 21:31 ` samueldotj at gmail dot com
2012-06-28 10:00 ` [Bug middle-end/53790] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: samueldotj at gmail dot com @ 2012-06-27 21:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #4 from Samuel Jacob <samueldotj at gmail dot com> 2012-06-27 21:31:25 UTC ---
Also this doesnt happen with extern structures and variables.
ie
typedef struct u u_t; or typedef int u_t;
is not causing the ICE.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (3 preceding siblings ...)
2012-06-27 21:31 ` samueldotj at gmail dot com
@ 2012-06-28 10:00 ` rguenth at gcc dot gnu.org
2012-06-28 11:45 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 10:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Keywords| |ice-on-valid-code
Last reconfirmed| |2012-06-28
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
Summary|ICE on dereferencing a |[4.6/4.7/4.8 Regression]
|extern union in asm |ICE on dereferencing a
|statement |extern union in asm
| |statement
Target Milestone|--- |4.6.4
Known to fail| |4.8.0
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 09:59:40 UTC ---
Confirmed. There is nothing invalid here, you can take the address of
such variable - you just cannot inspect it. Of course that is what
inlining exposes here (and via MEM_REF we get to see the external decl).
Hmhm.
I'll look at it.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (4 preceding siblings ...)
2012-06-28 10:00 ` [Bug middle-end/53790] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-06-28 11:45 ` rguenth at gcc dot gnu.org
2012-06-28 11:53 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 11:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 11:45:18 UTC ---
Author: rguenth
Date: Thu Jun 28 11:45:14 2012
New Revision: 189045
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189045
Log:
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
* gcc.dg/torture/pr53790.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr53790.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (5 preceding siblings ...)
2012-06-28 11:45 ` rguenth at gcc dot gnu.org
@ 2012-06-28 11:53 ` rguenth at gcc dot gnu.org
2012-06-28 12:01 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 11:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 11:52:54 UTC ---
Author: rguenth
Date: Thu Jun 28 11:52:49 2012
New Revision: 189047
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189047
Log:
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
* gcc.dg/torture/pr53790.c: New testcase.
Added:
branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/torture/pr53790.c
Modified:
branches/gcc-4_7-branch/gcc/ChangeLog
branches/gcc-4_7-branch/gcc/expr.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (6 preceding siblings ...)
2012-06-28 11:53 ` rguenth at gcc dot gnu.org
@ 2012-06-28 12:01 ` rguenth at gcc dot gnu.org
2012-06-28 12:02 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 12:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 12:01:22 UTC ---
Author: rguenth
Date: Thu Jun 28 12:01:16 2012
New Revision: 189048
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189048
Log:
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
* gcc.dg/torture/pr53790.c: New testcase.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr53790.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/expr.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (7 preceding siblings ...)
2012-06-28 12:01 ` rguenth at gcc dot gnu.org
@ 2012-06-28 12:02 ` rguenth at gcc dot gnu.org
2012-06-28 12:02 ` rguenth at gcc dot gnu.org
2012-06-29 0:26 ` samueldotj at gmail dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 12:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 12:01:38 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (8 preceding siblings ...)
2012-06-28 12:02 ` rguenth at gcc dot gnu.org
@ 2012-06-28 12:02 ` rguenth at gcc dot gnu.org
2012-06-29 0:26 ` samueldotj at gmail dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-28 12:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 12:01:22 UTC ---
Author: rguenth
Date: Thu Jun 28 12:01:16 2012
New Revision: 189048
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189048
Log:
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
* gcc.dg/torture/pr53790.c: New testcase.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr53790.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/expr.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 12:01:38 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/53790] [4.6/4.7/4.8 Regression] ICE on dereferencing a extern union in asm statement
2012-06-27 21:17 [Bug middle-end/53790] New: ICE on dereferencing a extern union in asm statement samueldotj at gmail dot com
` (9 preceding siblings ...)
2012-06-28 12:02 ` rguenth at gcc dot gnu.org
@ 2012-06-29 0:26 ` samueldotj at gmail dot com
10 siblings, 0 replies; 12+ messages in thread
From: samueldotj at gmail dot com @ 2012-06-29 0:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53790
--- Comment #10 from Samuel Jacob <samueldotj at gmail dot com> 2012-06-29 00:26:44 UTC ---
(In reply to comment #9)
> Fixed.
Thanks Richard for the quick response.
^ permalink raw reply [flat|nested] 12+ messages in thread