* [PR77719] Fix ICE in pp_string, at pretty-print.c:955
@ 2016-09-25 7:46 Dominique d'Humières
0 siblings, 0 replies; 4+ messages in thread
From: Dominique d'Humières @ 2016-09-25 7:46 UTC (permalink / raw)
To: kugan.vivekanandarajah; +Cc: gcc-patches
Hi,
Two possibilities:
(a) pass -w in the dg-options
(b) replace INTEGER, PARAMETER :: dp=8 with INTEGER, PARAMETER :: dp=8, spdim=42 (or any number you like!-).
Dominique
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR77719] Fix ICE in pp_string, at pretty-print.c:955
2016-09-26 6:44 ` kugan
@ 2016-09-26 15:46 ` Jeff Law
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2016-09-26 15:46 UTC (permalink / raw)
To: kugan, gcc-patches
On 09/25/2016 08:39 PM, kugan wrote:
>
>
> On 25/09/16 04:50, kugan wrote:
>> Hi,
>>
>> In make_new_ssa_for_def (tree-reassoc.c) we should use gimple_get_lhs to
>> get lhs instead of gimple_assign_lhs as stmt can be builtins too.
>> Attached patch fixes this.
>>
>> Testcase from PR (attached) seems to fail. I dont any fortran so I didnt
>> try fixing it. Any help here is appreciate. The log is:
>
> Here is a patch with the testcase based on the feedback from Joost
> VandeVondele and Dominique d'Humieres. Bootstrapped and regression
> tested on x86_64-linux-gnu with no new regressions.
>
> Is this OK for trunk?
>
> Thanks,
> kugan
>
> gcc/testsuite/ChangeLog:
>
> 2016-09-25 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> * gfortran.dg/pr77719.f90: New test.
>
> gcc/ChangeLog:
>
> 2016-09-25 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> * tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to
> get lhs
> instead of gimple_assign_lhs as stmt can be builtins too.
>
OK.
jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR77719] Fix ICE in pp_string, at pretty-print.c:955
2016-09-25 7:07 kugan
@ 2016-09-26 6:44 ` kugan
2016-09-26 15:46 ` Jeff Law
0 siblings, 1 reply; 4+ messages in thread
From: kugan @ 2016-09-26 6:44 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
On 25/09/16 04:50, kugan wrote:
> Hi,
>
> In make_new_ssa_for_def (tree-reassoc.c) we should use gimple_get_lhs to
> get lhs instead of gimple_assign_lhs as stmt can be builtins too.
> Attached patch fixes this.
>
> Testcase from PR (attached) seems to fail. I dont any fortran so I didnt
> try fixing it. Any help here is appreciate. The log is:
Here is a patch with the testcase based on the feedback from Joost
VandeVondele and Dominique d'Humieres. Bootstrapped and regression
tested on x86_64-linux-gnu with no new regressions.
Is this OK for trunk?
Thanks,
kugan
gcc/testsuite/ChangeLog:
2016-09-25 Kugan Vivekanandarajah <kuganv@linaro.org>
* gfortran.dg/pr77719.f90: New test.
gcc/ChangeLog:
2016-09-25 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs
instead of gimple_assign_lhs as stmt can be builtins too.
[-- Attachment #2: pr77719.txt --]
[-- Type: text/plain, Size: 1427 bytes --]
diff --git a/gcc/testsuite/gfortran.dg/pr77719.f90 b/gcc/testsuite/gfortran.dg/pr77719.f90
index e69de29..974d70a 100644
--- a/gcc/testsuite/gfortran.dg/pr77719.f90
+++ b/gcc/testsuite/gfortran.dg/pr77719.f90
@@ -0,0 +1,26 @@
+! PR middle-end/77719
+! { dg-do compile }
+! { dg-options "-O3 -ffast-math" }
+
+SUBROUTINE urep_egr(erep,derep,surr)
+ INTEGER, PARAMETER :: dp=8
+ REAL(dp), INTENT(inout) :: erep, derep(3)
+ REAL(dp), INTENT(in) :: surr(2)
+ REAL(dp) :: de_z, rz
+ INTEGER :: isp,spdim,jsp,nsp
+ IF (n_urpoly > 0) THEN
+ IF (r < spxr(1,1)) THEN
+ ispg: DO isp = 1,spdim ! condition ca)
+ IF (isp /= spdim) THEN
+ nsp = 5 ! condition cb
+ DO jsp = 0,nsp
+ IF( jsp <= 3 ) THEN
+ ELSE
+ erep = erep + surr(jsp-3)*rz**(jsp)
+ ENDIF
+ END DO
+ END IF
+ END DO ispg
+ END IF
+ END IF
+END SUBROUTINE urep_egr
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 8fc76e4..d94ff70 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1158,7 +1158,7 @@ make_new_ssa_for_def (gimple *stmt)
use_operand_p use;
imm_use_iterator iter;
tree new_lhs;
- tree lhs = gimple_assign_lhs (stmt);
+ tree lhs = gimple_get_lhs (stmt);
new_lhs = make_ssa_name (TREE_TYPE (lhs));
gimple_set_lhs (stmt, new_lhs);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PR77719] Fix ICE in pp_string, at pretty-print.c:955
@ 2016-09-25 7:07 kugan
2016-09-26 6:44 ` kugan
0 siblings, 1 reply; 4+ messages in thread
From: kugan @ 2016-09-25 7:07 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1927 bytes --]
Hi,
In make_new_ssa_for_def (tree-reassoc.c) we should use gimple_get_lhs to
get lhs instead of gimple_assign_lhs as stmt can be builtins too.
Attached patch fixes this.
Testcase from PR (attached) seems to fail. I dont any fortran so I didnt
try fixing it. Any help here is appreciate. The log is:
Executing on host:
/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../gfortran
-B/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../
-B/home/kugan.vivekanandarajah/build/x86_64-pc-linux-gnu/./libgfortran/
/home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90
-fno-diagnostics-show-caret -fdiagnostics-color=never -O -O3
-ffast-math -S -o pr77719.s (timeout = 300)
spawn
/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../gfortran
-B/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../
-B/home/kugan.vivekanandarajah/build/x86_64-pc-linux-gnu/./libgfortran/
/home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90
-fno-diagnostics-show-caret -fdiagnostics-color=never -O -O3 -ffast-math
-S -o pr77719.s^M
/home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90:11:23:
Warning: Deleted feature: End expression in DO loop at (1) must be integer^M
output is:
/home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90:11:23:
Warning: Deleted feature: End expression in DO loop at (1) must be integer^M
FAIL: gfortran.dg/pr77719.f90 -O (test for excess errors)
Excess errors:
I didn't add it due to this. I will leave it to someone else.
Bootstrapped and regression tested the attached patch on
x86_64-linux-gnu with no new regressions.
Is this OK for trunk?
Thanks,
Kugan
gcc/ChangeLog:
2016-09-24 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs
instead of gimple_assign_lhs as stmt can be builtins too.
[-- Attachment #2: pr77719.txt --]
[-- Type: text/plain, Size: 432 bytes --]
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 8fc76e4..d94ff70 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1158,7 +1158,7 @@ make_new_ssa_for_def (gimple *stmt)
use_operand_p use;
imm_use_iterator iter;
tree new_lhs;
- tree lhs = gimple_assign_lhs (stmt);
+ tree lhs = gimple_get_lhs (stmt);
new_lhs = make_ssa_name (TREE_TYPE (lhs));
gimple_set_lhs (stmt, new_lhs);
[-- Attachment #3: pr77719.f90 --]
[-- Type: text/x-fortran, Size: 712 bytes --]
! PR middle-end/77719
! { dg-do compile }
! { dg-options "-O3 -ffast-math" }
SUBROUTINE urep_egr(erep,derep,surr)
INTEGER, PARAMETER :: dp=8
REAL(dp), INTENT(inout) :: erep, derep(3)
REAL(dp), INTENT(in) :: surr(2)
REAL(dp) :: de_z, rz
IF (n_urpoly > 0) THEN
IF (r < spxr(1,1)) THEN
ispg: DO isp = 1,spdim ! condition ca)
IF (isp /= spdim) THEN
nsp = 5 ! condition cb
DO jsp = 0,nsp
IF( jsp <= 3 ) THEN
ELSE
erep = erep + surr(jsp-3)*rz**(jsp)
ENDIF
END DO
END IF
END DO ispg
END IF
END IF
END SUBROUTINE urep_egr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-26 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-25 7:46 [PR77719] Fix ICE in pp_string, at pretty-print.c:955 Dominique d'Humières
-- strict thread matches above, loose matches on Subject: below --
2016-09-25 7:07 kugan
2016-09-26 6:44 ` kugan
2016-09-26 15:46 ` Jeff Law
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).