GCC Bugzilla – Attachment 54142 Details for
Bug 108166
[12 Regression] Wrong code with -O2 since r12-8078-ga42aa68bf1ad745a
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
gcc13-pr108166.patch
gcc13-pr108166.patch (text/plain), 1.30 KB, created by
Jakub Jelinek
on 2022-12-21 13:35:24 UTC
(
hide
)
Description:
gcc13-pr108166.patch
Filename:
MIME Type:
Creator:
Jakub Jelinek
Created:
2022-12-21 13:35:24 UTC
Size:
1.30 KB
patch
obsolete
>2022-12-21 Jakub Jelinek <jakub@redhat.com> > > PR tree-optimization/108166 > * tree-ssa-phiopt.cc (value_replacement): For the maybe_equal_p > case turned into equal_p reset SSA_NAME_RANGE_INFO of phi result. > > * g++.dg/torture/pr108166.C: New test. > >--- gcc/tree-ssa-phiopt.cc.jj 2022-10-28 11:00:53.970243821 +0200 >+++ gcc/tree-ssa-phiopt.cc 2022-12-21 14:27:58.118326548 +0100 >@@ -1491,6 +1491,12 @@ value_replacement (basic_block cond_bb, > default: > break; > } >+ if (equal_p) >+ /* After the optimization PHI result can have value >+ which it couldn't have previously. >+ We could instead of resetting it union the range >+ info with oarg. */ >+ reset_flow_sensitive_info (gimple_phi_result (phi)); > if (equal_p && MAY_HAVE_DEBUG_BIND_STMTS) > { > imm_use_iterator imm_iter; >--- gcc/testsuite/g++.dg/torture/pr108166.C.jj 2022-12-21 14:31:02.638661322 +0100 >+++ gcc/testsuite/g++.dg/torture/pr108166.C 2022-12-21 14:30:45.441909725 +0100 >@@ -0,0 +1,26 @@ >+// PR tree-optimization/108166 >+// { dg-do run } >+ >+bool a, b; >+int d, c; >+ >+const int & >+foo (const int &f, const int &g) >+{ >+ return !f ? f : g; >+} >+ >+__attribute__((noipa)) void >+bar (int) >+{ >+} >+ >+int >+main () >+{ >+ c = foo (b, 0) > ((b ? d : b) ?: 8); >+ a = b ? d : b; >+ bar (a); >+ if (a != 0) >+ __builtin_abort (); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 108166
: 54142