* [Bug c/26092] ICE on const function pointer assigned to malloc
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
@ 2006-02-03 17:18 ` kohler at cs dot ucla dot edu
2006-02-03 18:15 ` [Bug middle-end/26092] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kohler at cs dot ucla dot edu @ 2006-02-03 17:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from kohler at cs dot ucla dot edu 2006-02-03 17:18 -------
Created an attachment (id=10776)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10776&action=view)
preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to malloc
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
2006-02-03 17:18 ` [Bug c/26092] " kohler at cs dot ucla dot edu
@ 2006-02-03 18:15 ` pinskia at gcc dot gnu dot org
2006-02-03 18:19 ` [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-03 18:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-02-03 18:15 -------
Reduced testcase:
typedef __SIZE_TYPE__ size_t;
extern void *malloc (size_t __size);
void *(* const f)(size_t) = malloc;
void *gg(void) {
return (*f)(3);
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c |middle-end
Ever Confirmed|0 |1
GCC build triplet|i486-linux-gnu |
GCC host triplet|i486-linux-gnu |
GCC target triplet|i486-linux-gnu |
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2006-02-03 18:15:01
date| |
Summary|ICE on const function |[4.0/4.1/4.2 Regression] ICE
|pointer assigned to malloc |on const function pointer
| |assigned to malloc
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
2006-02-03 17:18 ` [Bug c/26092] " kohler at cs dot ucla dot edu
2006-02-03 18:15 ` [Bug middle-end/26092] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-02-03 18:19 ` pinskia at gcc dot gnu dot org
2006-02-03 18:23 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-03 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-02-03 18:19 -------
2028 /* Try this again in case gimplification exposed something. */
Malloc is just a builtin function, this ICE happens with any builtin function.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0/4.1/4.2 Regression] ICE|[4.0/4.1/4.2 Regression] ICE
|on const function pointer |on const function pointer
|assigned to malloc |assigned to a builtin
| |function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (2 preceding siblings ...)
2006-02-03 18:19 ` [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function pinskia at gcc dot gnu dot org
@ 2006-02-03 18:23 ` pinskia at gcc dot gnu dot org
2006-02-08 12:19 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-03 18:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-02-03 18:23 -------
What happens here is that we call get_callee_fndecl before gimplifying the
expression f(3) and we get back malloc because of code in get_callee_fndecl
for:
/* If this is a readonly function pointer, extract its initial value. */
And then we go along and gimplifiy this expression and we get:
f.0(3) as the expression as the load for f is done before as f.0 = f;.
and then calling get_callee_fndecl on this new expression we get NULL and so we
crash as we pass that to fold_builtins.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (3 preceding siblings ...)
2006-02-03 18:23 ` pinskia at gcc dot gnu dot org
@ 2006-02-08 12:19 ` jakub at gcc dot gnu dot org
2006-02-13 21:28 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-02-08 12:19 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2006-02-03 18:15:01 |2006-02-08 12:19:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (4 preceding siblings ...)
2006-02-08 12:19 ` jakub at gcc dot gnu dot org
@ 2006-02-13 21:28 ` jakub at gcc dot gnu dot org
2006-02-13 21:29 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-02-13 21:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2006-02-13 21:28 -------
Subject: Bug 26092
Author: jakub
Date: Mon Feb 13 21:28:03 2006
New Revision: 110927
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110927
Log:
PR middle-end/26092
* gimplify.c (gimplify_call_expr): Don't call get_callee_fndecl
twice if decl is a builtin. When trying again, call get_callee_fndecl
first to verify it is still a builtin.
* gcc.c-torture/compile/20060208-1.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0/4.1/4.2 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (5 preceding siblings ...)
2006-02-13 21:28 ` jakub at gcc dot gnu dot org
@ 2006-02-13 21:29 ` jakub at gcc dot gnu dot org
2006-02-13 21:42 ` [Bug middle-end/26092] [4.0 " pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-02-13 21:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2006-02-13 21:29 -------
Subject: Bug 26092
Author: jakub
Date: Mon Feb 13 21:29:13 2006
New Revision: 110928
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110928
Log:
PR middle-end/26092
* gimplify.c (gimplify_call_expr): Don't call get_callee_fndecl
twice if decl is a builtin. When trying again, call get_callee_fndecl
first to verify it is still a builtin.
* gcc.c-torture/compile/20060208-1.c: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/gimplify.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (6 preceding siblings ...)
2006-02-13 21:29 ` jakub at gcc dot gnu dot org
@ 2006-02-13 21:42 ` pinskia at gcc dot gnu dot org
2006-02-27 20:29 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 21:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2006-02-13 21:42 -------
Fixed for 4.2.0 and 4.1.0 at least.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.2.0 4.1.0 4.0.0 4.0.3 |4.0.0 4.0.3
Known to work|3.4.0 3.3.3 3.2.3 3.0.4 |3.4.0 3.3.3 3.2.3 3.0.4
|2.95.3 |2.95.3 4.2.0 4.1.0
Summary|[4.0/4.1/4.2 Regression] ICE|[4.0 Regression] ICE on
|on const function pointer |const function pointer
|assigned to a builtin |assigned to a builtin
|function |function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (7 preceding siblings ...)
2006-02-13 21:42 ` [Bug middle-end/26092] [4.0 " pinskia at gcc dot gnu dot org
@ 2006-02-27 20:29 ` mmitchel at gcc dot gnu dot org
2006-02-28 20:09 ` jakub at gcc dot gnu dot org
2006-02-28 22:20 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-02-27 20:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from mmitchel at gcc dot gnu dot org 2006-02-27 20:29 -------
Jakub, does this patch apply to 4.0.x?
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (8 preceding siblings ...)
2006-02-27 20:29 ` mmitchel at gcc dot gnu dot org
@ 2006-02-28 20:09 ` jakub at gcc dot gnu dot org
2006-02-28 22:20 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-02-28 20:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2006-02-28 19:58 -------
Subject: Bug 26092
Author: jakub
Date: Tue Feb 28 19:58:33 2006
New Revision: 111572
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111572
Log:
PR middle-end/26092
* gimplify.c (gimplify_call_expr): When trying again, call
get_callee_fndecl first to verify it is still a builtin.
* gcc.c-torture/compile/20060208-1.c: New test.
Added:
branches/gcc-4_0-branch/gcc/testsuite/gcc.c-torture/compile/20060208-1.c
Modified:
branches/gcc-4_0-branch/gcc/ChangeLog
branches/gcc-4_0-branch/gcc/gimplify.c
branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26092] [4.0 Regression] ICE on const function pointer assigned to a builtin function
2006-02-03 17:18 [Bug c/26092] New: ICE on const function pointer assigned to malloc kohler at cs dot ucla dot edu
` (9 preceding siblings ...)
2006-02-28 20:09 ` jakub at gcc dot gnu dot org
@ 2006-02-28 22:20 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-28 22:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-02-28 22:20 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26092
^ permalink raw reply [flat|nested] 12+ messages in thread