objsz: Don't call replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI [PR94423]
The following testcase ICEs because the objsz pass calls replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI SSA_NAME. The following patch instead of that calls replace_call_with_value, which will turn it into xyz_123(ab) = 234; 2020-04-01 Jakub Jelinek <jakub@redhat.com> PR middle-end/94423 * tree-object-size.c (pass_object_sizes::execute): Don't call replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead call replace_call_with_value. * gcc.dg/ubsan/pr94423.c: New test.
This commit is contained in:
parent
142d68f50b
commit
9ecb3ecc8c
@ -1,3 +1,10 @@
|
||||
2020-04-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/94423
|
||||
* tree-object-size.c (pass_object_sizes::execute): Don't call
|
||||
replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead
|
||||
call replace_call_with_value.
|
||||
|
||||
2020-04-01 Kewen Lin <linkw@gcc.gnu.org>
|
||||
|
||||
PR tree-optimization/94043
|
||||
|
@ -1,3 +1,8 @@
|
||||
2020-04-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/94423
|
||||
* gcc.dg/ubsan/pr94423.c: New test.
|
||||
|
||||
2020-04-01 Kewen Lin <linkw@gcc.gnu.org>
|
||||
|
||||
PR tree-optimization/94043
|
||||
|
17
gcc/testsuite/gcc.dg/ubsan/pr94423.c
Normal file
17
gcc/testsuite/gcc.dg/ubsan/pr94423.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* PR middle-end/94423 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fsanitize=object-size" } */
|
||||
|
||||
void foo (void);
|
||||
typedef struct { long buf[22]; } jmp_buf[1];
|
||||
extern int sigsetjmp (jmp_buf, int) __attribute__ ((__nothrow__));
|
||||
jmp_buf buf;
|
||||
|
||||
void
|
||||
bar (int *c)
|
||||
{
|
||||
while (*c)
|
||||
foo ();
|
||||
while (*c)
|
||||
sigsetjmp (buf, 0);
|
||||
}
|
@ -1393,7 +1393,10 @@ pass_object_sizes::execute (function *fun)
|
||||
}
|
||||
|
||||
/* Propagate into all uses and fold those stmts. */
|
||||
replace_uses_by (lhs, result);
|
||||
if (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
|
||||
replace_uses_by (lhs, result);
|
||||
else
|
||||
replace_call_with_value (&i, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user