Commit 2b57045b by Uros Bizjak

re PR target/46716 (wrong code generated with -mno-sse2 -m64)

	PR target/46716
	* config/i386/i386.c (construct_container): Use gen_reg_or_parallel
	to pass the argument in the register of "natural" mode.

testsuite/ChangeLog:

	PR target/46716
	* gcc.target/i386/pr46176.c: New test.

From-SVN: r184802
parent 08c38658
2012-03-02 Uros Bizjak <ubizjak@gmail.com>
PR target/46716
* config/i386/i386.c (construct_container): Use gen_reg_or_parallel
to pass the argument in the register of "natural" mode.
2012-03-02 Richard Guenther <rguenther@suse.de> 2012-03-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52406 PR tree-optimization/52406
...@@ -20,10 +26,10 @@ ...@@ -20,10 +26,10 @@
2012-03-02 Greta Yorsh <Greta.Yorsh@arm.com> 2012-03-02 Greta Yorsh <Greta.Yorsh@arm.com>
* config/arm/arm-ldmstm.ml (write_ldm_commutative_peephole): * config/arm/arm-ldmstm.ml (write_ldm_commutative_peephole):
Improve conditions for peepholes of loads followed by commutative Improve conditions for peepholes of loads followed by commutative
operators. operators.
* config/arm/ldmstm.md: Regenerated. * config/arm/ldmstm.md: Regenerated.
2012-03-02 Richard Guenther <rguenther@suse.de> 2012-03-02 Richard Guenther <rguenther@suse.de>
...@@ -125,7 +131,7 @@ ...@@ -125,7 +131,7 @@
2012-03-01 Georg-Johann Lay <avr@gjlay.de> 2012-03-01 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr-c.c (avr_cpu_cpp_builtins): Restore built-in * config/avr/avr-c.c (avr_cpu_cpp_builtins): Restore built-in
defines for __UINT24_MAX__, __INT24_MAX__, __INT24_MIN__ defines for __UINT24_MAX__, __INT24_MAX__, __INT24_MIN__
unintentionally removed in r184616. unintentionally removed in r184616.
2012-03-01 Venkataramanan Kumar <venkataramanan.kumar@amd.com> 2012-03-01 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
...@@ -251,8 +257,7 @@ ...@@ -251,8 +257,7 @@
(neon_vcgeu): New insn. (neon_vcgeu): New insn.
(neon_vcgtu): Likewise. (neon_vcgtu): Likewise.
* config/arm/neon.ml (s_8_32, u_8_32): New lists. * config/arm/neon.ml (s_8_32, u_8_32): New lists.
(ops): Unsigned comparison intrinsics call a different (ops): Unsigned comparison intrinsics call a different builtin.
builtin.
2012-02-28 Richard Guenther <rguenther@suse.de> 2012-02-28 Richard Guenther <rguenther@suse.de>
...@@ -281,7 +286,7 @@ ...@@ -281,7 +286,7 @@
* config/avr/avr-devices.c (avr_mcu_type): Adjust NULL part * config/avr/avr-devices.c (avr_mcu_type): Adjust NULL part
of initializer to changes from r184614. of initializer to changes from r184614.
2012-02-28 Richard Guenther <rguenther@suse.de> 2012-02-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52395 PR tree-optimization/52395
...@@ -350,8 +355,7 @@ ...@@ -350,8 +355,7 @@
2012-02-27 H.J. Lu <hongjiu.lu@intel.com> 2012-02-27 H.J. Lu <hongjiu.lu@intel.com>
PR target/52352 PR target/52352
* config/i386/i386.md (*movabs<mode>_1): Enable only for * config/i386/i386.md (*movabs<mode>_1): Enable only for TARGET_LP64.
TARGET_LP64.
(*movabs<mode>_2): Likewise. (*movabs<mode>_2): Likewise.
2012-02-27 Jakub Jelinek <jakub@redhat.com> 2012-02-27 Jakub Jelinek <jakub@redhat.com>
......
...@@ -5829,7 +5829,8 @@ classify_argument (enum machine_mode mode, const_tree type, ...@@ -5829,7 +5829,8 @@ classify_argument (enum machine_mode mode, const_tree type,
{ {
HOST_WIDE_INT bytes = HOST_WIDE_INT bytes =
(mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
int words = (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int words
= (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
/* Variable sized entities are always passed/returned in memory. */ /* Variable sized entities are always passed/returned in memory. */
if (bytes < 0) if (bytes < 0)
...@@ -5879,7 +5880,8 @@ classify_argument (enum machine_mode mode, const_tree type, ...@@ -5879,7 +5880,8 @@ classify_argument (enum machine_mode mode, const_tree type,
misaligned integers. */ misaligned integers. */
if (DECL_BIT_FIELD (field)) if (DECL_BIT_FIELD (field))
{ {
for (i = (int_bit_position (field) + (bit_offset % 64)) / 8 / 8; for (i = (int_bit_position (field)
+ (bit_offset % 64)) / 8 / 8;
i < ((int_bit_position (field) + (bit_offset % 64)) i < ((int_bit_position (field) + (bit_offset % 64))
+ tree_low_cst (DECL_SIZE (field), 0) + tree_low_cst (DECL_SIZE (field), 0)
+ 63) / 8 / 8; i++) + 63) / 8 / 8; i++)
...@@ -5919,7 +5921,8 @@ classify_argument (enum machine_mode mode, const_tree type, ...@@ -5919,7 +5921,8 @@ classify_argument (enum machine_mode mode, const_tree type,
+ bit_offset) % 256); + bit_offset) % 256);
if (!num) if (!num)
return 0; return 0;
pos = (int_bit_position (field) + (bit_offset % 64)) / 8 / 8; pos = (int_bit_position (field)
+ (bit_offset % 64)) / 8 / 8;
for (i = 0; i < num && (i + pos) < words; i++) for (i = 0; i < num && (i + pos) < words; i++)
classes[i + pos] = classes[i + pos] =
merge_classes (subclasses[i], classes[i + pos]); merge_classes (subclasses[i], classes[i + pos]);
...@@ -6336,21 +6339,27 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, ...@@ -6336,21 +6339,27 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode,
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
if (n == 2 && regclass[0] == X86_64_SSE_CLASS if (n == 2
&& regclass[1] == X86_64_SSEUP_CLASS && mode != BLKmode) && regclass[0] == X86_64_SSE_CLASS
return gen_rtx_REG (mode, SSE_REGNO (sse_regno)); && regclass[1] == X86_64_SSEUP_CLASS
&& mode != BLKmode)
return gen_reg_or_parallel (mode, orig_mode,
SSE_REGNO (sse_regno));
if (n == 4 if (n == 4
&& regclass[0] == X86_64_SSE_CLASS && regclass[0] == X86_64_SSE_CLASS
&& regclass[1] == X86_64_SSEUP_CLASS && regclass[1] == X86_64_SSEUP_CLASS
&& regclass[2] == X86_64_SSEUP_CLASS && regclass[2] == X86_64_SSEUP_CLASS
&& regclass[3] == X86_64_SSEUP_CLASS && regclass[3] == X86_64_SSEUP_CLASS
&& mode != BLKmode) && mode != BLKmode)
return gen_rtx_REG (mode, SSE_REGNO (sse_regno)); return gen_reg_or_parallel (mode, orig_mode,
SSE_REGNO (sse_regno));
if (n == 2 if (n == 2
&& regclass[0] == X86_64_X87_CLASS && regclass[1] == X86_64_X87UP_CLASS) && regclass[0] == X86_64_X87_CLASS
&& regclass[1] == X86_64_X87UP_CLASS)
return gen_rtx_REG (XFmode, FIRST_STACK_REG); return gen_rtx_REG (XFmode, FIRST_STACK_REG);
if (n == 2 && regclass[0] == X86_64_INTEGER_CLASS
if (n == 2
&& regclass[0] == X86_64_INTEGER_CLASS
&& regclass[1] == X86_64_INTEGER_CLASS && regclass[1] == X86_64_INTEGER_CLASS
&& (mode == CDImode || mode == TImode || mode == TFmode) && (mode == CDImode || mode == TImode || mode == TFmode)
&& intreg[0] + 1 == intreg[1]) && intreg[0] + 1 == intreg[1])
...@@ -6369,31 +6378,36 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, ...@@ -6369,31 +6378,36 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode,
case X86_64_INTEGERSI_CLASS: case X86_64_INTEGERSI_CLASS:
/* Merge TImodes on aligned occasions here too. */ /* Merge TImodes on aligned occasions here too. */
if (i * 8 + 8 > bytes) if (i * 8 + 8 > bytes)
tmpmode = mode_for_size ((bytes - i * 8) * BITS_PER_UNIT, MODE_INT, 0); tmpmode
= mode_for_size ((bytes - i * 8) * BITS_PER_UNIT, MODE_INT, 0);
else if (regclass[i] == X86_64_INTEGERSI_CLASS) else if (regclass[i] == X86_64_INTEGERSI_CLASS)
tmpmode = SImode; tmpmode = SImode;
else else
tmpmode = DImode; tmpmode = DImode;
/* We've requested 24 bytes we don't have mode for. Use DImode. */ /* We've requested 24 bytes we
don't have mode for. Use DImode. */
if (tmpmode == BLKmode) if (tmpmode == BLKmode)
tmpmode = DImode; tmpmode = DImode;
exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, exp [nexps++]
gen_rtx_REG (tmpmode, *intreg), = gen_rtx_EXPR_LIST (VOIDmode,
GEN_INT (i*8)); gen_rtx_REG (tmpmode, *intreg),
GEN_INT (i*8));
intreg++; intreg++;
break; break;
case X86_64_SSESF_CLASS: case X86_64_SSESF_CLASS:
exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, exp [nexps++]
gen_rtx_REG (SFmode, = gen_rtx_EXPR_LIST (VOIDmode,
SSE_REGNO (sse_regno)), gen_rtx_REG (SFmode,
GEN_INT (i*8)); SSE_REGNO (sse_regno)),
GEN_INT (i*8));
sse_regno++; sse_regno++;
break; break;
case X86_64_SSEDF_CLASS: case X86_64_SSEDF_CLASS:
exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, exp [nexps++]
gen_rtx_REG (DFmode, = gen_rtx_EXPR_LIST (VOIDmode,
SSE_REGNO (sse_regno)), gen_rtx_REG (DFmode,
GEN_INT (i*8)); SSE_REGNO (sse_regno)),
GEN_INT (i*8));
sse_regno++; sse_regno++;
break; break;
case X86_64_SSE_CLASS: case X86_64_SSE_CLASS:
...@@ -6423,10 +6437,11 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, ...@@ -6423,10 +6437,11 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode,
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, exp [nexps++]
gen_rtx_REG (tmpmode, = gen_rtx_EXPR_LIST (VOIDmode,
SSE_REGNO (sse_regno)), gen_rtx_REG (tmpmode,
GEN_INT (pos*8)); SSE_REGNO (sse_regno)),
GEN_INT (pos*8));
sse_regno++; sse_regno++;
break; break;
default: default:
2012-03-02 Uros Bizjak <ubizjak@gmail.com>
PR target/46716
* gcc.target/i386/pr46176.c: New test.
2012-03-02 Paolo Carlini <paolo.carlini@oracle.com> 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51989 PR c++/51989
...@@ -30,8 +35,7 @@ ...@@ -30,8 +35,7 @@
* gcc.dg/torture/pr47917.c: Make test using POSIX-printf * gcc.dg/torture/pr47917.c: Make test using POSIX-printf
routines on mingw targets. routines on mingw targets.
* gcc.dg/vect/pr46126.c (uintptr_t): Add support for * gcc.dg/vect/pr46126.c (uintptr_t): Add support for LLP64 target.
LLP64 target.
2012-03-01 Jakub Jelinek <jakub@redhat.com> 2012-03-01 Jakub Jelinek <jakub@redhat.com>
...@@ -125,18 +129,15 @@ ...@@ -125,18 +129,15 @@
2012-02-28 Kai Tietz <ktietz@redhat.com> 2012-02-28 Kai Tietz <ktietz@redhat.com>
* gcc.target/i386/pr46939.c (long): Fix LP64 vs LLP64 * gcc.target/i386/pr46939.c (long): Fix LP64 vs LLP64 issue.
issue.
* gcc.target/i386/pr45352-2.c: Likewise. * gcc.target/i386/pr45352-2.c: Likewise.
* gcc.target/i386/bitfield3.c: Add -mno-ms-bitfields for * gcc.target/i386/bitfield3.c: Add -mno-ms-bitfields for mingw targets.
mingw targets. * gcc.target/i386/xop-vshift-1.c (random): Use on mingw
* gcc.target/i386/xop-vshift-1.c(random): Use on mingw
targets instead rand. targets instead rand.
* gcc.target/i386/sse4_1-blendps-2.c: Likewise. * gcc.target/i386/sse4_1-blendps-2.c: Likewise.
* gcc.target/i386/sse2-mul-1.c: Likewise. * gcc.target/i386/sse2-mul-1.c: Likewise.
* gcc.target/i386/sse4_1-blendps.c: Likewise. * gcc.target/i386/sse4_1-blendps.c: Likewise.
* gcc.target/i386/pad-6b.c: Adjust test for x64 mingw * gcc.target/i386/pad-6b.c: Adjust test for x64 mingw target.
target.
* gcc.target/i386/pad-1.c: Likewise. * gcc.target/i386/pad-1.c: Likewise.
* gcc.target/i386/pad-9.c: Likewise. * gcc.target/i386/pad-9.c: Likewise.
* gcc.target/i386/pad-2.c: Likewise. * gcc.target/i386/pad-2.c: Likewise.
...@@ -222,8 +223,7 @@ ...@@ -222,8 +223,7 @@
2012-02-23 Kai Tietz <ktietz@redhat.com> 2012-02-23 Kai Tietz <ktietz@redhat.com>
* gcc.dg/pack-test-5.c: Add -mno-ms-bitfields option * gcc.dg/pack-test-5.c: Add -mno-ms-bitfields option for mingw-targets.
for mingw-targets.
* gcc.dg/Wpadded.c: Likewise. * gcc.dg/Wpadded.c: Likewise.
* gcc.dg/bf-ms-layout-2.c: Adjust offsets to fit ms-bitfield * gcc.dg/bf-ms-layout-2.c: Adjust offsets to fit ms-bitfield
structure-layout. structure-layout.
...@@ -233,8 +233,7 @@ ...@@ -233,8 +233,7 @@
targets. targets.
* gcc.dg/stack-usage-1.c (SIZE): Provide proper SIZE for x64 mingw * gcc.dg/stack-usage-1.c (SIZE): Provide proper SIZE for x64 mingw
target. target.
* gcc.dg/tls/thr-cse-1.c: Provide proper pattern for x64 mingw * gcc.dg/tls/thr-cse-1.c: Provide proper pattern for x64 mingw target.
target.
* gcc.dg/tls/opt-11.c (memset): Use __extension__ to avoid fail * gcc.dg/tls/opt-11.c (memset): Use __extension__ to avoid fail
on x64 mingw target. on x64 mingw target.
* gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout. * gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout.
......
/* { dg-do run } */
/* { dg-options "-O2 -msse -mno-sse2" } */
/* { dg-require-effective-target sse } */
#include "sse-check.h"
typedef double V __attribute__ ((__vector_size__ (16), __may_alias__));
typedef union
{
V x;
double a[2];
} u;
#define EMM_FLT8(a) ((double *)&(a))
void __attribute__ ((noinline))
test (V s1, V s2)
{
if (EMM_FLT8(s1)[0] != EMM_FLT8(s2)[0]
|| EMM_FLT8(s1)[1] != EMM_FLT8(s2)[1])
abort ();
}
static void
sse_test (void)
{
u s1;
s1.a[0] = 1.0;
s1.a[1] = 2.0;
test (s1.x, s1.x);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment