diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2019-08-27 19:23:59 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2019-08-27 19:23:59 +0200 |
commit | c1441faf150e00d2090e268cf78390cbd2636859 (patch) | |
tree | 82a977403c674cf77b82029d0c9b3867c0685bda | |
parent | c8935981ff34d8ed32f81b37aa7a68edf4c53efe (diff) | |
download | gcc-c1441faf150e00d2090e268cf78390cbd2636859.zip gcc-c1441faf150e00d2090e268cf78390cbd2636859.tar.gz gcc-c1441faf150e00d2090e268cf78390cbd2636859.tar.bz2 |
re PR target/91528 (ICE in ix86_expand_prologue at i386.c:7844 since r274481)
PR target/91528
* config/i386/i386-features.c (convert_scalars_to_vector):
Update crtl->stack_realign_needed, crtl->stack_realign_tried and
crtl->stack_realign_processed. Update crtl->drap_reg by calling
targetm.calls.get_drap_rtx. If drap_rtx is non-null then
Update crtl->args.internal_arg_pointer and call fixup_tail_calls.
testsuite/ChangeLog:
PR target/91528
* gcc.target/i386/pr91528.c: New test.
From-SVN: r274962
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/i386/i386-features.c | 26 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr91528.c | 14 |
4 files changed, 54 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 65f9db9..39459d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2019-08-27 Uroš Bizjak <ubizjak@gmail.com> + + PR target/91528 + * config/i386/i386-features.c (convert_scalars_to_vector): + Update crtl->stack_realign_needed, crtl->stack_realign_tried and + crtl->stack_realign_processed. Update crtl->drap_reg by calling + targetm.calls.get_drap_rtx. If drap_rtx is non-null then + Update crtl->args.internal_arg_pointer and call fixup_tail_calls. + 2019-08-27 Richard Biener <rguenther@suse.de> * config/i386/i386-features.h diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c index 9505b4a..6eb1482 100644 --- a/gcc/config/i386/i386-features.c +++ b/gcc/config/i386/i386-features.c @@ -1651,6 +1651,32 @@ convert_scalars_to_vector (bool timode_p) crtl->stack_alignment_needed = 128; if (crtl->stack_alignment_estimated < 128) crtl->stack_alignment_estimated = 128; + + crtl->stack_realign_needed + = INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated; + crtl->stack_realign_tried = crtl->stack_realign_needed; + + crtl->stack_realign_processed = true; + + if (!crtl->drap_reg) + { + rtx drap_rtx = targetm.calls.get_drap_rtx (); + + /* stack_realign_drap and drap_rtx must match. */ + gcc_assert ((stack_realign_drap != 0) == (drap_rtx != NULL)); + + /* Do nothing if NULL is returned, + which means DRAP is not needed. */ + if (drap_rtx != NULL) + { + crtl->args.internal_arg_pointer = drap_rtx; + + /* Call fixup_tail_calls to clean up + REG_EQUIV note if DRAP is needed. */ + fixup_tail_calls (); + } + } + /* Fix up DECL_RTL/DECL_INCOMING_RTL of arguments. */ if (TARGET_64BIT) for (tree parm = DECL_ARGUMENTS (current_function_decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9bc1a3f..c9185e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-27 Uroš Bizjak <ubizjak@gmail.com> + + PR target/91528 + * gcc.target/i386/pr91528.c: New test. + 2019-08-27 Martin Sebor <msebor@redhat.com> PR c++/83431 diff --git a/gcc/testsuite/gcc.target/i386/pr91528.c b/gcc/testsuite/gcc.target/i386/pr91528.c new file mode 100644 index 0000000..add2111 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr91528.c @@ -0,0 +1,14 @@ +/* PR target/91528 */ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-Os -mavx512vbmi2 -mforce-drap" } */ + +extern long int labs (long int j); + +int +main () +{ + long *a = (long *)"empty"; + int i = 1441516387; + a[i] = labs (a[i]); + return 0; +} |