[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-05-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #57 from Marek Polacek  ---
Author: mpolacek
Date: Fri May  5 15:38:04 2017
New Revision: 247639

URL: https://gcc.gnu.org/viewcvs?rev=247639=gcc=rev
Log:
PR target/77728
* config/arm/arm.c: Include gimple.h.
(aapcs_layout_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment ncrn if it returned non-zero.
(arm_needs_doubleword_align): Return int instead of bool,
ignore DECL_ALIGN of non-FIELD_DECL TYPE_FIELDS chain
members, but if there is any such non-FIELD_DECL
> PARM_BOUNDARY aligned decl, return -1 instead of false.
(arm_function_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment nregs if it returned non-zero.
(arm_setup_incoming_varargs): Likewise.
(arm_function_arg_boundary): Emit -Wpsabi note if
arm_needs_doubleword_align returns negative, return
DOUBLEWORD_ALIGNMENT if it returned non-zero.

* g++.dg/abi/pr77728-1.C: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/abi/pr77728-1.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/arm/arm.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #56 from Jakub Jelinek  ---
Author: jakub
Date: Thu Apr 27 07:14:24 2017
New Revision: 247293

URL: https://gcc.gnu.org/viewcvs?rev=247293=gcc=rev
Log:
PR target/77728
* config/aarch64/aarch64.c (struct aarch64_fn_arg_alignment): Remove.
(aarch64_function_arg_alignment): Return unsigned int again, but still
ignore TYPE_FIELDS chain decls other than FIELD_DECLs.
(aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
Don't emit -Wpsabi note.
(aarch64_function_arg_boundary): Likewise.
(aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
caller.
testsuite/
* g++.dg/abi/pr77728-2.C: Don't expect -Wpsabi notes.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/aarch64/aarch64.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/abi/pr77728-2.C

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #55 from Jakub Jelinek  ---
Author: jakub
Date: Thu Apr 27 07:13:10 2017
New Revision: 247292

URL: https://gcc.gnu.org/viewcvs?rev=247292=gcc=rev
Log:
PR target/77728
* config/aarch64/aarch64.c (struct aarch64_fn_arg_alignment): Remove.
(aarch64_function_arg_alignment): Return unsigned int again, but still
ignore TYPE_FIELDS chain decls other than FIELD_DECLs.
(aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
Don't emit -Wpsabi note.
(aarch64_function_arg_boundary): Likewise.
(aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
caller.
testsuite/
* g++.dg/abi/pr77728-2.C: Don't expect -Wpsabi notes.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/abi/pr77728-2.C

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #54 from Jakub Jelinek  ---
The notices are only for ABI of actually compiled code, so it depends on
optimizations, if functions are inlined or optimized away, we don't report
anything, so at -O0 when fewer functions are inlined and almost nothing is
optimized away you can get more -Wpsabi notices.

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-26 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Richard Earnshaw  changed:

   What|Removed |Added

 CC||biblbroks at hotmail dot com

--- Comment #53 from Richard Earnshaw  ---
*** Bug 69841 has been marked as a duplicate of this bug. ***

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-26 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Richard Earnshaw  changed:

   What|Removed |Added

 CC||klug.stefan at gmx dot de

--- Comment #52 from Richard Earnshaw  ---
*** Bug 80149 has been marked as a duplicate of this bug. ***

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-26 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #51 from Richard Earnshaw  ---
(In reply to Jonathan Wakely from comment #50)
> (In reply to ktkachov from comment #3)
> > Started with r225465.
> > Something to do with alignment.
> > I wonder if it's related to PR69841 ?
> 
> Seems to be the same. Maybe PR 80149 too?

With the latest trunk sources the testcase for PR80149 triggers the new ABI
change warning; the testcase for PR69841 does also, but only when optimization
is O1 or lower.

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #50 from Jonathan Wakely  ---
(In reply to ktkachov from comment #3)
> Started with r225465.
> Something to do with alignment.
> I wonder if it's related to PR69841 ?

Seems to be the same. Maybe PR 80149 too?

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-25 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #49 from rguenther at suse dot de  ---
On April 25, 2017 5:20:29 PM GMT+02:00, "jakub at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728
>
>--- Comment #39 from Jakub Jelinek  ---
>It is an ABI change, so I think it is highly undesirable to backport. 
>It is
>enough that people will have to rebuild many packages built by GCC 7
>prereleases, if it is backported, they would have to rebuild also
>anything
>built by GCC 5 or 6.

Not sure if really a good option but one could back port a change just ignoring
TYPE_DECLs which means making the ABI self-consistent but still incompatible
with both 5.2 and 7.1 ... (Or provide configurability via -mabi-version and a
default chosen at configure time...)

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-25 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #48 from Yichao Yu  ---
Thanks for fixing this. I didn't follow all the comments since I'm not familiar
with the C++ ABI so just to make sure I understand what's happening is it that
the bug is caused by a inconsistency in C++ ABI for certain classes which can
happen on both ARM and AArch64 (although not for AArch64 in this case)?

Is this now fixed for gcc 7+ for both ARM and AArch64? (Should this be closed
now or only when there's a release?) And btw, when is the estimated release
time of 7.1?

[Bug target/77728] [5/6 Regression] Miscompilation multiple vector iteration on ARM

2017-04-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[5/6/7/8 Regression]|[5/6 Regression]
   |Miscompilation multiple |Miscompilation multiple
   |vector iteration on ARM |vector iteration on ARM

--- Comment #47 from Jakub Jelinek  ---
Fixed for 7.1+.