* [Bug c/31128] ICE with __builtin_stack_restore
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
@ 2007-03-11 1:51 ` pinskia at gcc dot gnu dot org
2007-03-11 1:58 ` [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-11 1:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-11 01:51 -------
I get a different ICE on the mainline with checking enabled:
t.c:1: internal compiler error: tree check: expected tree that contains 'decl
with RTL' structure, have 'addr_expr' in expand_stack_restore, at stmt.c:2012
Really this builtin should not be exposed to the user.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
2007-03-11 1:51 ` [Bug c/31128] " pinskia at gcc dot gnu dot org
@ 2007-03-11 1:58 ` pinskia at gcc dot gnu dot org
2007-03-11 2:16 ` nicholas at mxc dot ca
` (11 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-11 1:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-03-11 01:58 -------
I have a patch to force this not to be exposed to the user, these builtin was
never documented so they should not be exposed and they are never used outside
of the internals of the compiler either.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-03-11 01:58:22
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
2007-03-11 1:51 ` [Bug c/31128] " pinskia at gcc dot gnu dot org
2007-03-11 1:58 ` [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user pinskia at gcc dot gnu dot org
@ 2007-03-11 2:16 ` nicholas at mxc dot ca
2007-03-11 2:20 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: nicholas at mxc dot ca @ 2007-03-11 2:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from nicholas at mxc dot ca 2007-03-11 02:16 -------
That's fair; we were relying on an undocumented builtin (see llvm.org/PR1028).
If you remove it, can you provide a substitute?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (2 preceding siblings ...)
2007-03-11 2:16 ` nicholas at mxc dot ca
@ 2007-03-11 2:20 ` pinskia at gcc dot gnu dot org
2007-03-11 2:57 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-11 2:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2007-03-11 02:20 -------
The solution I have for you is to use VLAs correctly and {}, basically going
lowered VLAs of __builtin_stack_restore/__builtin_stack_save/__builtin_alloca
to back VLAs.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (3 preceding siblings ...)
2007-03-11 2:20 ` pinskia at gcc dot gnu dot org
@ 2007-03-11 2:57 ` pinskia at gcc dot gnu dot org
2007-05-28 17:44 ` sabre at nondot dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-11 2:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2007-03-11 02:57 -------
Created an attachment (id=13187)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13187&action=view)
patch which hides the stack functions
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (4 preceding siblings ...)
2007-03-11 2:57 ` pinskia at gcc dot gnu dot org
@ 2007-05-28 17:44 ` sabre at nondot dot org
2007-05-28 19:08 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: sabre at nondot dot org @ 2007-05-28 17:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from sabre at nondot dot org 2007-05-28 17:44 -------
This is very useful for compilers generating C code (e.g. LLVM, and various
other source -> C compilers). Why remove it? These compilers are generating
partially structured code, that don't have syntactic blocks required for VLAs.
--
sabre at nondot dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sabre at nondot dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (5 preceding siblings ...)
2007-05-28 17:44 ` sabre at nondot dot org
@ 2007-05-28 19:08 ` pinskia at gcc dot gnu dot org
2007-05-29 15:14 ` sabre at nondot dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-28 19:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2007-05-28 19:08 -------
(In reply to comment #6)
> This is very useful for compilers generating C code (e.g. LLVM, and various
> other source -> C compilers). Why remove it? These compilers are generating
> partially structured code, that don't have syntactic blocks required for VLAs.
Because there are better ways of implementing that in the generated C code.
You can create a fake VLA (that is of size 0).
Like:
int f(int t1)
{
{
int t = 0;
int a[t];
int *b = __builtin_alloca(t1);
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (6 preceding siblings ...)
2007-05-28 19:08 ` pinskia at gcc dot gnu dot org
@ 2007-05-29 15:14 ` sabre at nondot dot org
2007-11-17 18:21 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: sabre at nondot dot org @ 2007-05-29 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from sabre at nondot dot org 2007-05-29 15:14 -------
Right, you could do that, but it is a) not guaranteed to work going forward,
and b) expects properly structured (e.g. nested) control flow.
If I had b, I could just make a vla :)
-Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (7 preceding siblings ...)
2007-05-29 15:14 ` sabre at nondot dot org
@ 2007-11-17 18:21 ` pinskia at gcc dot gnu dot org
2007-11-17 19:25 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-17 18:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2007-11-17 18:21 -------
*** Bug 34134 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |edwintorok at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (8 preceding siblings ...)
2007-11-17 18:21 ` pinskia at gcc dot gnu dot org
@ 2007-11-17 19:25 ` jakub at gcc dot gnu dot org
2007-11-28 20:57 ` sabre at nondot dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-17 19:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jakub at gcc dot gnu dot org 2007-11-17 19:25 -------
Created an attachment (id=14573)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14573&action=view)
gcc43-pr34134.patch
Patch to avoid the ICE.
I don't mind the patch which disables these builtins either, but
1) it might be better to add the space at the end of builtin's name rather than
in the middle
2) have you posted it to gcc-patches?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (9 preceding siblings ...)
2007-11-17 19:25 ` jakub at gcc dot gnu dot org
@ 2007-11-28 20:57 ` sabre at nondot dot org
2007-12-04 22:02 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: sabre at nondot dot org @ 2007-11-28 20:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from sabre at nondot dot org 2007-11-28 20:57 -------
Please don't disable these. There are a variety of compilers that optionally
or only generate C code, particularly for the functional languages. This is
useful functionality for these compilers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (10 preceding siblings ...)
2007-11-28 20:57 ` sabre at nondot dot org
@ 2007-12-04 22:02 ` jakub at gcc dot gnu dot org
2008-01-03 18:04 ` pinskia at gcc dot gnu dot org
2008-01-24 19:13 ` edmar at freescale dot com
13 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-12-04 22:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from jakub at gcc dot gnu dot org 2007-12-04 22:01 -------
Fixed on the trunk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (11 preceding siblings ...)
2007-12-04 22:02 ` jakub at gcc dot gnu dot org
@ 2008-01-03 18:04 ` pinskia at gcc dot gnu dot org
2008-01-24 19:13 ` edmar at freescale dot com
13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-03 18:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from pinskia at gcc dot gnu dot org 2008-01-03 17:48 -------
I am not going to work on this anymore.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
2007-03-11 1:46 [Bug c/31128] New: ICE with __builtin_stack_restore nicholas at mxc dot ca
` (12 preceding siblings ...)
2008-01-03 18:04 ` pinskia at gcc dot gnu dot org
@ 2008-01-24 19:13 ` edmar at freescale dot com
13 siblings, 0 replies; 16+ messages in thread
From: edmar at freescale dot com @ 2008-01-24 19:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from edmar at freescale dot com 2008-01-24 18:57 -------
(In reply to comment #10)
> Created an attachment (id=14573)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14573&action=view) [edit]
> gcc43-pr34134.patch
>
> Patch to avoid the ICE.
>
> I don't mind the patch which disables these builtins either, but
> 1) it might be better to add the space at the end of builtin's name rather than
> in the middle
> 2) have you posted it to gcc-patches?
>
I still see a problem on PowerPC. From dejagnu logfile:
Executing on host: /tmp/edmar/build_cde/job_28/obj_gcc/gcc/xgcc
-B/tmp/edmar/build_cde/job_28/obj_gcc/gcc/ -O0 -w -fno-show-column -c
-o 20071117-1.o
/tmp/edmar/build_cde/job_28/gcc/gcc/testsuite/gcc.c-torture/compile/20071117-1.c
(timeout = 300)
/tmp/edmar/build_cde/job_28/gcc/gcc/testsuite/gcc.c-torture/compile/20071117-1.c:
In function 'foo':
/tmp/edmar/build_cde/job_28/gcc/gcc/testsuite/gcc.c-torture/compile/20071117-1.c:13:
error: unrecognizable insn:
(insn 29 28 30 3
/tmp/edmar/build_cde/job_28/gcc/gcc/testsuite/gcc.c-torture/compile/20071117-1.c:10
(set (mem/c:SI (mem/f/c/i:SI (plus:SI (reg/f:SI 115 virtual-stack-vars)
(const_int 4 [0x4])) [0 p+0 S4 A32]) [0 S4 A8])
(reg:SI 134)) -1 (nil))
/tmp/edmar/build_cde/job_28/gcc/gcc/testsuite/gcc.c-torture/compile/20071117-1.c:13:
internal compiler error: in extract_insn, at recog.c:1990
--
edmar at freescale dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |edmar at freescale dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128
^ permalink raw reply [flat|nested] 16+ messages in thread