* [Bug fortran/51338] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
@ 2011-11-28 21:49 ` dcb314 at hotmail dot com
2011-11-28 21:59 ` bdavis at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2011-11-28 21:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #1 from dcb <dcb314 at hotmail dot com> 2011-11-28 21:10:25 UTC ---
Created attachment 25940
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25940
preprocessed Fortran code
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
2011-11-28 21:49 ` [Bug fortran/51338] " dcb314 at hotmail dot com
@ 2011-11-28 21:59 ` bdavis at gcc dot gnu.org
2011-11-28 22:23 ` bdavis at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: bdavis at gcc dot gnu.org @ 2011-11-28 21:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Bud Davis <bdavis at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bdavis at gcc dot gnu.org
--- Comment #2 from Bud Davis <bdavis at gcc dot gnu.org> 2011-11-28 21:40:40 UTC ---
Program received signal SIGSEGV, Segmentation fault.
0x081bc9af in gfc_dep_compare_expr (e1=0x0, e2=0x0) at
../../gcc/gcc/fortran/dependency.c:242
242 {
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.7.el6_0.5.i686
(gdb) bt
#0 0x081bc9af in gfc_dep_compare_expr (e1=0x0, e2=0x0) at
../../gcc/gcc/fortran/dependency.c:242
#1 0x081bd105 in are_identical_variables (e1=0x905d440, e2=0x905c520) at
../../gcc/gcc/fortran/dependency.c:177
#2 gfc_dep_compare_expr (e1=0x905d440, e2=0x905c520) at
../../gcc/gcc/fortran/dependency.c:438
#3 0x081be244 in gfc_dep_compare_functions (e1=0x905d668, e2=0x905d2f0,
impure_ok=true)
at ../../gcc/gcc/fortran/dependency.c:221
#4 0x0823bf67 in cfe_expr_0 (e=0x905cdb8, walk_subtrees=0xbfffee3c, data=0x0)
at ../../gcc/gcc/fortran/frontend-passes.c:386
#5 0x0823bbd6 in gfc_expr_walker (e=0x905cdb8, exprfn=0x823bea0
<cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0)
at ../../gcc/gcc/fortran/frontend-passes.c:1039
#6 0x0823c72c in gfc_code_walker (c=0x905c4b8, codefn=0x823ae40
<cfe_code(gfc_code**, int*, void*)>,
exprfn=0x823bea0 <cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0) at
../../gcc/gcc/fortran/frontend-passes.c:1361
#7 0x0823c70e in gfc_code_walker (c=0x905c670, codefn=0x823ae40
<cfe_code(gfc_code**, int*, void*)>,
exprfn=0x823bea0 <cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0) at
../../gcc/gcc/fortran/frontend-passes.c:1363
#8 0x0823c70e in gfc_code_walker (c=0x905c150, codefn=0x823ae40
<cfe_code(gfc_code**, int*, void*)>,
exprfn=0x823bea0 <cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0) at
../../gcc/gcc/fortran/frontend-passes.c:1363
#9 0x0823c70e in gfc_code_walker (c=0x9058620, codefn=0x823ae40
<cfe_code(gfc_code**, int*, void*)>,
exprfn=0x823bea0 <cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0) at
../../gcc/gcc/fortran/frontend-passes.c:1363
#10 0x0823c70e in gfc_code_walker (c=0x9057608, codefn=0x823ae40
<cfe_code(gfc_code**, int*, void*)>,
exprfn=0x823bea0 <cfe_expr_0(gfc_expr**, int*, void*)>, data=0x0) at
../../gcc/gcc/fortran/frontend-passes.c:1363
#11 0x0823d25c in optimize_namespace (ns=0x9055320) at
../../gcc/gcc/fortran/frontend-passes.c:510
#12 0x0823d2ea in gfc_run_passes (ns=0x9055320) at
../../gcc/gcc/fortran/frontend-passes.c:80
#13 0x0818a4b9 in resolve_all_program_units () at
../../gcc/gcc/fortran/parse.c:4342
#14 gfc_parse_file () at ../../gcc/gcc/fortran/parse.c:4608
#15 0x081c641d in gfc_be_parse_file () at ../../gcc/gcc/fortran/f95-lang.c:250
#16 0x085a97c5 in compile_file (argc=21, argv=0xbffff1f4) at
../../gcc/gcc/toplev.c:565
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
2011-11-28 21:49 ` [Bug fortran/51338] " dcb314 at hotmail dot com
2011-11-28 21:59 ` bdavis at gcc dot gnu.org
@ 2011-11-28 22:23 ` bdavis at gcc dot gnu.org
2011-11-28 22:50 ` [Bug fortran/51338] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: bdavis at gcc dot gnu.org @ 2011-11-28 22:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #3 from Bud Davis <bdavis at gcc dot gnu.org> 2011-11-28 21:59:02 UTC ---
Reduced:
SUBROUTINE PAXCUT(CHIN,CHOUT)
CHARACTER*(*) CHIN,CHOUT
IF(INDEX(CHOUT(K:),'.OR.').EQ.INDEX(CHOUT(K:),'.AND.')) THEN
ENDIF
END
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (2 preceding siblings ...)
2011-11-28 22:23 ` bdavis at gcc dot gnu.org
@ 2011-11-28 22:50 ` dominiq at lps dot ens.fr
2011-11-28 23:10 ` bdavis at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-11-28 22:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-11-28
CC| |tkoenig at gcc dot gnu.org
Summary|seg fault in |[4.6/4.7 Regression] seg
|gfc_dep_compare_expr with |fault in
|-O2 |gfc_dep_compare_expr with
| |-O2
Ever Confirmed|0 |1
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-11-28 22:22:59 UTC ---
Workaround -fno-frontend-optimize.
Revision 164728 (20100929) is OK
revision 165415 (20101013) gives the segmentation fault.
Likely
Revision 165248
Author: tkoenig
Date: Sun Oct 10 09:52:46 2010 UTC (13 months, 2 weeks ago)
Changed paths: 7
Log Message:
2010-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
* frontend-passes.c: Include opts.h.
(optimize_comparison): Renamed from optimize_equality.
Change second argument to operation to be compared.
Use flag_finite_math_only to avoid comparing REAL and
COMPLEX only when NANs are honored. Simplify comparing
of string concatenations where left or right operands are
equal. Simplify all comparison operations, based on the result
of gfc_dep_compare_expr.
* dependency.c: Include arith.h.
(gfc_are_identical_variables): Volatile variables should not
compare equal to themselves.
(gfc_dep_compare_expr): Handle string constants and string
concatenations.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (3 preceding siblings ...)
2011-11-28 22:50 ` [Bug fortran/51338] [4.6/4.7 Regression] " dominiq at lps dot ens.fr
@ 2011-11-28 23:10 ` bdavis at gcc dot gnu.org
2011-11-28 23:45 ` bdavis at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: bdavis at gcc dot gnu.org @ 2011-11-28 23:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #5 from Bud Davis <bdavis at gcc dot gnu.org> 2011-11-28 22:49:33 UTC ---
Index: gcc/gcc/fortran/dependency.c
===================================================================
--- gcc/gcc/fortran/dependency.c (revision 181789)
+++ gcc/gcc/fortran/dependency.c (working copy)
@@ -245,6 +245,10 @@
int i;
gfc_expr *n1, *n2;
+ /* nothing to do here, move along */
+ if (e1 == NULL && e2 == NULL)
+ return 0;
+
n1 = NULL;
n2 = NULL;
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (4 preceding siblings ...)
2011-11-28 23:10 ` bdavis at gcc dot gnu.org
@ 2011-11-28 23:45 ` bdavis at gcc dot gnu.org
2011-11-29 17:48 ` tkoenig at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: bdavis at gcc dot gnu.org @ 2011-11-28 23:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #6 from Bud Davis <bdavis at gcc dot gnu.org> 2011-11-28 23:20:27 UTC ---
The above patch has no new testsuite regressions.
If someone wants to check and make sure the optimisation(s) that could or were
being done is still correct, and check this in, feel free to do so.
1 Hour 40 minutes after bug posted. not bad.....
--bud
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (5 preceding siblings ...)
2011-11-28 23:45 ` bdavis at gcc dot gnu.org
@ 2011-11-29 17:48 ` tkoenig at gcc dot gnu.org
2011-12-05 14:21 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-11-29 17:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |tkoenig at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-11-29 17:45:05 UTC ---
(In reply to comment #6)
> The above patch has no new testsuite regressions.
> If someone wants to check and make sure the optimisation(s) that could or were
> being done is still correct, and check this in, feel free to do so.
>
> 1 Hour 40 minutes after bug posted. not bad.....
>
I'll look at it. Thanks for the analysis and the fix!
Thomas
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (6 preceding siblings ...)
2011-11-29 17:48 ` tkoenig at gcc dot gnu.org
@ 2011-12-05 14:21 ` rguenth at gcc dot gnu.org
2011-12-05 14:41 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-05 14:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (7 preceding siblings ...)
2011-12-05 14:21 ` rguenth at gcc dot gnu.org
@ 2011-12-05 14:41 ` burnus at gcc dot gnu.org
2011-12-05 16:27 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-05 14:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-05 14:40:56 UTC ---
(In reply to comment #7)
> I'll look at it. Thanks for the analysis and the fix!
Thomas' patch: http://gcc.gnu.org/ml/fortran/2011-11/msg00254.html
Review (approval): http://gcc.gnu.org/ml/fortran/2011-12/msg00023.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (8 preceding siblings ...)
2011-12-05 14:41 ` burnus at gcc dot gnu.org
@ 2011-12-05 16:27 ` jakub at gcc dot gnu.org
2011-12-05 20:12 ` tkoenig at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-12-05 16:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
CC| |jakub at gcc dot gnu.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (9 preceding siblings ...)
2011-12-05 16:27 ` jakub at gcc dot gnu.org
@ 2011-12-05 20:12 ` tkoenig at gcc dot gnu.org
2011-12-11 20:06 ` tkoenig at gcc dot gnu.org
2011-12-11 20:11 ` tkoenig at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-05 20:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-05 20:11:53 UTC ---
Author: tkoenig
Date: Mon Dec 5 20:11:44 2011
New Revision: 182024
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182024
Log:
2011-12-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
* dependency.c (are_identical_variables): Handle case where
end fields of substring references are NULL.
2011-12-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
* gfortran.dg/assumed_charlen_substring_1.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/assumed_charlen_substring_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/dependency.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (10 preceding siblings ...)
2011-12-05 20:12 ` tkoenig at gcc dot gnu.org
@ 2011-12-11 20:06 ` tkoenig at gcc dot gnu.org
2011-12-11 20:11 ` tkoenig at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 20:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:03:47 UTC ---
Author: tkoenig
Date: Sun Dec 11 20:03:43 2011
New Revision: 182209
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182209
Log:
2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
Backport from trunk
* dependency.c (are_identical_variables): Handle case where
end fields of substring references are NULL.
2011-12-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51338
Backport from trunk
* gfortran.dg/assumed_charlen_substring_1.f90: New test.
Modified:
branches/gcc-4_6-branch/gcc/fortran/ChangeLog
branches/gcc-4_6-branch/gcc/fortran/dependency.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/51338] [4.6/4.7 Regression] seg fault in gfc_dep_compare_expr with -O2
2011-11-28 21:10 [Bug fortran/51338] New: seg fault in gfc_dep_compare_expr with -O2 dcb314 at hotmail dot com
` (11 preceding siblings ...)
2011-12-11 20:06 ` tkoenig at gcc dot gnu.org
@ 2011-12-11 20:11 ` tkoenig at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-12-11 20:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51338
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:04:39 UTC ---
Fixed on trunk and 4.6, closing.
^ permalink raw reply [flat|nested] 14+ messages in thread