public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/54552] New: Cast to pointer to VLA crash the compiler
@ 2012-09-11 16:09 jens.gustedt at loria dot fr
2012-09-11 16:12 ` [Bug c/54552] " jens.gustedt at loria dot fr
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: jens.gustedt at loria dot fr @ 2012-09-11 16:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Bug #: 54552
Summary: Cast to pointer to VLA crash the compiler
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jens.gustedt@loria.fr
Created attachment 28172
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28172
code to reproduce the problem
I stumbled int to a case where a cast (double(*)[n]) crashes the compiler,
whereas first having a typedef for the VLA works ok.
I attach code that reproduces the problem for me. The bug is present as well in
gcc 4.6.3 as in 4.7.0. This is on an ubuntu x86_64, but I don't think that this
should matter.
Jens
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
@ 2012-09-11 16:12 ` jens.gustedt at loria dot fr
2012-09-11 16:18 ` [Bug c/54552] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jens.gustedt at loria dot fr @ 2012-09-11 16:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
--- Comment #1 from Jens Gustedt <jens.gustedt at loria dot fr> 2012-09-11 16:11:59 UTC ---
The compiler error is
test-p99-gcc-bug.c:9:6: internal compiler error: in gimplify_expr, at
gimplify.c:7584
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7/4.8 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
2012-09-11 16:12 ` [Bug c/54552] " jens.gustedt at loria dot fr
@ 2012-09-11 16:18 ` jakub at gcc dot gnu.org
2012-09-14 21:17 ` jsm28 at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-11 16:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-09-11
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.6.4
Summary|Cast to pointer to VLA |[4.6/4.7/4.8 Regression]
|crash the compiler |Cast to pointer to VLA
| |crash the compiler
Ever Confirmed|0 |1
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-11 16:18:17 UTC ---
Fails since http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145254
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7/4.8 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
2012-09-11 16:12 ` [Bug c/54552] " jens.gustedt at loria dot fr
2012-09-11 16:18 ` [Bug c/54552] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
@ 2012-09-14 21:17 ` jsm28 at gcc dot gnu.org
2012-09-14 21:19 ` [Bug c/54552] [4.6/4.7 " jsm28 at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-14 21:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
--- Comment #3 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-14 21:17:00 UTC ---
Author: jsm28
Date: Fri Sep 14 21:16:56 2012
New Revision: 191313
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191313
Log:
c:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.
testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (2 preceding siblings ...)
2012-09-14 21:17 ` jsm28 at gcc dot gnu.org
@ 2012-09-14 21:19 ` jsm28 at gcc dot gnu.org
2012-09-15 0:29 ` jsm28 at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-14 21:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.6/4.7/4.8 Regression] |[4.6/4.7 Regression] Cast
|Cast to pointer to VLA |to pointer to VLA crash the
|crash the compiler |compiler
--- Comment #4 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-14 21:18:35 UTC ---
Fixed so far for trunk, pending testing fix for 4.7 and 4.6.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (3 preceding siblings ...)
2012-09-14 21:19 ` [Bug c/54552] [4.6/4.7 " jsm28 at gcc dot gnu.org
@ 2012-09-15 0:29 ` jsm28 at gcc dot gnu.org
2012-09-15 0:32 ` jsm28 at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-15 0:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
--- Comment #5 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-15 00:29:31 UTC ---
Author: jsm28
Date: Sat Sep 15 00:29:28 2012
New Revision: 191337
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191337
Log:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.
testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/c-typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (4 preceding siblings ...)
2012-09-15 0:29 ` jsm28 at gcc dot gnu.org
@ 2012-09-15 0:32 ` jsm28 at gcc dot gnu.org
2012-09-20 10:20 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-15 0:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.6.4 |4.7.2
--- Comment #6 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-15 00:31:49 UTC ---
Fixed for 4.6.4, 4.7 branch fix to follow after 4.7.2 is released.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (5 preceding siblings ...)
2012-09-15 0:32 ` jsm28 at gcc dot gnu.org
@ 2012-09-20 10:20 ` jakub at gcc dot gnu.org
2012-09-20 20:50 ` jsm28 at gcc dot gnu.org
2012-09-20 20:55 ` jsm28 at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-20 10:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.7.2 |4.7.3
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-20 10:13:00 UTC ---
GCC 4.7.2 has been released.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (6 preceding siblings ...)
2012-09-20 10:20 ` jakub at gcc dot gnu.org
@ 2012-09-20 20:50 ` jsm28 at gcc dot gnu.org
2012-09-20 20:55 ` jsm28 at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-20 20:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
--- Comment #8 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-20 20:50:27 UTC ---
Author: jsm28
Date: Thu Sep 20 20:50:17 2012
New Revision: 191591
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191591
Log:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.
testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.
Added:
branches/gcc-4_7-branch/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c
Modified:
branches/gcc-4_7-branch/gcc/ChangeLog
branches/gcc-4_7-branch/gcc/c-typeck.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
` (7 preceding siblings ...)
2012-09-20 20:50 ` jsm28 at gcc dot gnu.org
@ 2012-09-20 20:55 ` jsm28 at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-09-20 20:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|4.7.3 |4.6.4
--- Comment #9 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2012-09-20 20:55:24 UTC ---
Fixed for 4.6.4, 4.7.3, 4.8.0.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-09-20 20:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-11 16:09 [Bug c/54552] New: Cast to pointer to VLA crash the compiler jens.gustedt at loria dot fr
2012-09-11 16:12 ` [Bug c/54552] " jens.gustedt at loria dot fr
2012-09-11 16:18 ` [Bug c/54552] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
2012-09-14 21:17 ` jsm28 at gcc dot gnu.org
2012-09-14 21:19 ` [Bug c/54552] [4.6/4.7 " jsm28 at gcc dot gnu.org
2012-09-15 0:29 ` jsm28 at gcc dot gnu.org
2012-09-15 0:32 ` jsm28 at gcc dot gnu.org
2012-09-20 10:20 ` jakub at gcc dot gnu.org
2012-09-20 20:50 ` jsm28 at gcc dot gnu.org
2012-09-20 20:55 ` jsm28 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).