Hello Richard,

attached is my second attempt at fixing PR 57748. This time the movmisalign
path is completely removed and a similar bug in the read handling of misaligned
structures with a non-BLKmode is fixed too. There are several new test cases 
for the
different possible failure modes.

This patch was boot-strapped and regression tested onĀ  x86_64-unknown-linux-gnu
and i686-pc-linux-gnu.

Additionally I generated eCos and an eCos-application (on ARMv5 using packed
structures) with an arm-eabi cross compiler, and looked for differences in the
disassembled code with and without this patch, but there were none.

OK for trunk?

Regards
Bernd.                                    
2013-09-15  Bernd Edlinger  <bernd.edlin...@hotmail.de>

        PR middle-end/57748
        * expr.c (expand_assignment): Remove misalignp code path.
        Check for bitregion in offset arithmetic.
        (expand_expr_real_1): Use EXAND_MEMORY on base object.

testsuite:

        PR middle-end/57748
        * gcc.dg/torture/pr57748-1.c: New test.
        * gcc.dg/torture/pr57748-2.c: New test.
        * gcc.dg/torture/pr57748-3.c: New test.
        * gcc.dg/torture/pr57748-3a.c: New test.
        * gcc.dg/torture/pr57748-4.c: New test.
        * gcc.dg/torture/pr57748-4a.c: New test.

Attachment: patch-pr57748.diff
Description: Binary data

Reply via email to