OSDN Git Service

2005-11-16 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Nov 2005 11:35:00 +0000 (11:35 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Nov 2005 11:35:00 +0000 (11:35 +0000)
commit148ad152f2f6dad3160819dc6f471080d801d313
treefa01127a0e850334616461c97e66569538042b89
parent3eef7b639006d074108fa13492583e7d40e4b909
2005-11-16  Richard Guenther  <rguenther@suse.de>

PR middle-end/24851
* fold-const.c (extract_array_ref): Return byte offset
in all cases.
(fold_binary): Fold &x[a] CMP &x[b] to
a*sizeof(*x) CMP b*sizeof(*x) to get correct overflow
behavior.

* gcc.c-torture/execute/pr24851.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107117 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr24851.c [new file with mode: 0644]