re PR tree-optimization/21541 (gcc.c-torture/execute/20031215-1.c compilation fails)
PR 21541 * ifcvt.c (noce_process_if_block): Avoid conversion when the memory destination is readonly. From-SVN: r99951
This commit is contained in:
parent
e82766657d
commit
d2751e9ed5
2 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-05-18 Richard Henderson <rth@redhat.com>
|
||||
|
||||
PR 21541
|
||||
* ifcvt.c (noce_process_if_block): Avoid conversion when the
|
||||
memory destination is readonly.
|
||||
|
||||
2005-05-18 Richard Henderson <rth@redhat.com>
|
||||
|
||||
PR 21541
|
||||
|
|
|
@ -1981,6 +1981,14 @@ noce_process_if_block (struct ce_if_block * ce_info)
|
|||
if (side_effects_p (x))
|
||||
return FALSE;
|
||||
|
||||
/* If x is a read-only memory, then the program is valid only if we
|
||||
avoid the store into it. If there are stores on both the THEN and
|
||||
ELSE arms, then we can go ahead with the conversion; either the
|
||||
program is broken, or the condition is always false such that the
|
||||
other memory is selected. */
|
||||
if (!set_b && MEM_P (x) && MEM_READONLY_P (x))
|
||||
return FALSE;
|
||||
|
||||
b = (set_b ? SET_SRC (set_b) : x);
|
||||
|
||||
/* Only operate on register destinations, and even then avoid extending
|
||||
|
|
Loading…
Add table
Reference in a new issue