PR c/83844
commitaaaad063517dad09d02543db218d5ac81ed320af
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jan 2018 15:08:32 +0000 (16 15:08 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jan 2018 15:08:32 +0000 (16 15:08 +0000)
tree8c56b282c07c85b373c44f431ced983c5995758c
parentb692070ff0027e7579df15be1840bf55c4bd1055
PR c/83844
* stor-layout.c (handle_warn_if_not_align): Use byte_position and
multiple_of_p instead of unchecked tree_to_uhwi and UHWI check.
If off is not INTEGER_CST, issue a may not be aligned warning
rather than isn't aligned.  Use isn%'t rather than isn't.
* fold-const.c (multiple_of_p) <case BIT_AND_EXPR>: Don't fall through
into MULT_EXPR.
<case MULT_EXPR>: Improve the case when bottom and one of the
MULT_EXPR operands are INTEGER_CSTs and bottom is multiple of that
operand, in that case check if the other operand is multiple of
bottom divided by the INTEGER_CST operand.

* gcc.dg/pr83844.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256745 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83844.c [new file with mode: 0644]