public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
@ 2007-05-22 17:56 burnus at gcc dot gnu dot org
2007-05-22 18:01 ` [Bug middle-end/32046] " burnus at gcc dot gnu dot org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-05-22 17:56 UTC (permalink / raw)
To: gcc-bugs
The following examples run fine with -O1, but with -O2 they gfortran library
gives an error at run time.
$ gfortran -O gfortran.dg/interface_12.f90
$ ./a.out
$ gfortran -O2 gfortran.dg/interface_12.f90
$ ./a.out
Fortran runtime error: Attempt to allocate a negative amount of memory.
Analogously for gfortran.dg/result_in_spec_1.f90
--
Summary: [Regression 4.3] wrong code with -O2 for
gfortran.dg/interface_12.f90 & result_in_spec_1.f90
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/32046] [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
@ 2007-05-22 18:01 ` burnus at gcc dot gnu dot org
2007-05-22 18:04 ` [Bug fortran/32046] " pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-05-22 18:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2007-05-22 19:00 -------
Missed to write that the regression occured beween 2007-05-14-r124708 (working)
and 2007-05-15-r124736 (failing).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
2007-05-22 18:01 ` [Bug middle-end/32046] " burnus at gcc dot gnu dot org
@ 2007-05-22 18:04 ` pinskia at gcc dot gnu dot org
2007-05-22 18:14 ` burnus at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-22 18:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-05-22 19:04 -------
I bet this is like the other "Attempt to allocate a negative amount of memory"
and really a front-end issue with respect of mismatch types. Can you attach
-fdump-tree-original dump?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |fortran
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
2007-05-22 18:01 ` [Bug middle-end/32046] " burnus at gcc dot gnu dot org
2007-05-22 18:04 ` [Bug fortran/32046] " pinskia at gcc dot gnu dot org
@ 2007-05-22 18:14 ` burnus at gcc dot gnu dot org
2007-05-22 18:46 ` burnus at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-05-22 18:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2007-05-22 19:14 -------
Created an attachment (id=13603)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13603&action=view)
result_in_spec_1.f90.003t.original
As requested: The -fdump-tree-original of result_in_spec_1.f90.
It is time that there is a GCC-compile-time check for tree missmatches.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2007-05-22 18:14 ` burnus at gcc dot gnu dot org
@ 2007-05-22 18:46 ` burnus at gcc dot gnu dot org
2007-05-22 18:49 ` [Bug fortran/32046] [4.3 Regression] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-05-22 18:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2007-05-22 19:45 -------
FX, it seems that your patch contains mismatch types, which cause the wrong
code with -O2. At least if I revert your allocate patch, it no longer fails.
r124721 | fxcoudert | 2007-05-14 21:33:57 +0200 (Mon, 14 May 2007) | 39 lines
PR fortran/30723
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2007-05-22 18:46 ` burnus at gcc dot gnu dot org
@ 2007-05-22 18:49 ` pinskia at gcc dot gnu dot org
2007-05-22 19:33 ` fxcoudert at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-22 18:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2007-05-22 19:49 -------
D.1477 = (SAVE_EXPR <(<unnamed-unsigned:64>) (MAX_EXPR <D.1475, 0> + -1) +
1>) * 4;
int8 D.1477;
We have signed = unsigned * unknown ; I say unknown because I don't know off
the top of my head if 4 is signed or not (I think we should be printing out u
for unsigned INTEGER_CSTs).
(In reply to comment #4)
> FX, it seems that your patch contains mismatch types, which cause the wrong
> code with -O2. At least if I revert your allocate patch, it no longer fails.
Actually FX's patch just exposed the latent bug (as shown by the other bug, I
forgot the PR number).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-05-22 19:49:26
date| |
Summary|[Regression 4.3] wrong code |[4.3 Regression] wrong code
|with -O2 for |with -O2 for
|gfortran.dg/interface_12.f90|gfortran.dg/interface_12.f90
|& result_in_spec_1.f90 |& result_in_spec_1.f90
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-05-22 18:49 ` [Bug fortran/32046] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-05-22 19:33 ` fxcoudert at gcc dot gnu dot org
2007-05-22 21:38 ` patchapp at dberlin dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-22 19:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-05-22 20:33 -------
(In reply to comment #5)
> D.1477 = (SAVE_EXPR <(<unnamed-unsigned:64>) (MAX_EXPR <D.1475, 0> + -1) +
> 1>) * 4;
Yup, the following patch fixes it. I think there might be other occurences of
such a problem (basically, every time we use TYPE_SIZE_UNIT to create an array
size or offset).
Index: trans-array.c
===================================================================
--- trans-array.c (revision 124858)
+++ trans-array.c (working copy)
@@ -687,7 +687,8 @@ gfc_trans_create_temp_array (stmtblock_t
nelem = size;
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
- TYPE_SIZE_UNIT (gfc_get_element_type (type)));
+ fold_convert (gfc_array_index_type,
+ TYPE_SIZE_UNIT (gfc_get_element_type
(type))));
}
else
{
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-05-22 19:49:26 |2007-05-22 20:33:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (5 preceding siblings ...)
2007-05-22 19:33 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-22 21:38 ` patchapp at dberlin dot org
2007-05-23 8:25 ` fxcoudert at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-22 21:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from patchapp at dberlin dot org 2007-05-22 22:38 -------
Subject: Bug number PR32046
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01499.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (6 preceding siblings ...)
2007-05-22 21:38 ` patchapp at dberlin dot org
@ 2007-05-23 8:25 ` fxcoudert at gcc dot gnu dot org
2007-05-23 8:34 ` fxcoudert at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-23 8:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-05-23 09:25 -------
Subject: Bug 32046
Author: fxcoudert
Date: Wed May 23 08:25:05 2007
New Revision: 124985
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124985
Log:
PR fortran/32046
* trans-expr.c (gfc_trans_zero_assign): Convert the result of
TYPE_SIZE_UNIT into a signed type.
(gfc_trans_array_copy): Likewise.
(gfc_trans_array_constructor_copy): Likewise.
* trans-array.c (gfc_trans_create_temp_array): Likewise.
(gfc_grow_array): Likewise.
(gfc_array_init_size): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-stmt.c (allocate_temp_for_forall_nest_1): Likewise.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-stmt.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (7 preceding siblings ...)
2007-05-23 8:25 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-23 8:34 ` fxcoudert at gcc dot gnu dot org
2007-05-23 8:44 ` patchapp at dberlin dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-23 8:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from fxcoudert at gcc dot gnu dot org 2007-05-23 09:34 -------
Fixed.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (8 preceding siblings ...)
2007-05-23 8:34 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-23 8:44 ` patchapp at dberlin dot org
2007-06-22 4:46 ` daney at gcc dot gnu dot org
2007-11-11 6:25 ` daney at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-23 8:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from patchapp at dberlin dot org 2007-05-23 09:44 -------
Subject: Bug number PR32046
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01499.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (9 preceding siblings ...)
2007-05-23 8:44 ` patchapp at dberlin dot org
@ 2007-06-22 4:46 ` daney at gcc dot gnu dot org
2007-11-11 6:25 ` daney at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: daney at gcc dot gnu dot org @ 2007-06-22 4:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from daney at gcc dot gnu dot org 2007-06-22 04:46 -------
Subject: Bug 32046
Author: daney
Date: Fri Jun 22 04:46:08 2007
New Revision: 125941
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125941
Log:
PR target/32046
* config/mips/mips.md (define_constants): Rename UNSPEC_EH_RECEIVER
to UNSPEC_NONLOCAL_GOTO_RECEIVER globally.
(exception_receiver): Renamed to ...
(nonlocal_goto_receiver): ... this.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/mips/mips.md
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
` (10 preceding siblings ...)
2007-06-22 4:46 ` daney at gcc dot gnu dot org
@ 2007-11-11 6:25 ` daney at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: daney at gcc dot gnu dot org @ 2007-11-11 6:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from daney at gcc dot gnu dot org 2007-11-11 06:25 -------
Well obviously my commit attributed to this bug mentioned the wrong bug number.
I wonder if I can find the proper bug...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-11-11 6:25 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-22 17:56 [Bug middle-end/32046] New: [Regression 4.3] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90 burnus at gcc dot gnu dot org
2007-05-22 18:01 ` [Bug middle-end/32046] " burnus at gcc dot gnu dot org
2007-05-22 18:04 ` [Bug fortran/32046] " pinskia at gcc dot gnu dot org
2007-05-22 18:14 ` burnus at gcc dot gnu dot org
2007-05-22 18:46 ` burnus at gcc dot gnu dot org
2007-05-22 18:49 ` [Bug fortran/32046] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-05-22 19:33 ` fxcoudert at gcc dot gnu dot org
2007-05-22 21:38 ` patchapp at dberlin dot org
2007-05-23 8:25 ` fxcoudert at gcc dot gnu dot org
2007-05-23 8:34 ` fxcoudert at gcc dot gnu dot org
2007-05-23 8:44 ` patchapp at dberlin dot org
2007-06-22 4:46 ` daney at gcc dot gnu dot org
2007-11-11 6:25 ` daney at gcc dot gnu dot 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).