This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43546] [4.4/4.5 Regression] ICE: in assign_stack_local_1, at function.c:353 with -mpreferred-stack-boundary=2 -msseregparm
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2010 23:26:40 -0000
- Subject: [Bug target/43546] [4.4/4.5 Regression] ICE: in assign_stack_local_1, at function.c:353 with -mpreferred-stack-boundary=2 -msseregparm
- References: <bug-43546-14164@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from hjl dot tools at gmail dot com 2010-03-26 23:26 -------
We are trying to store DFmode with SFmode alignment since
compress_float_constant converts 1.0DF to 1.0SF. This patch
works around the problem:
--
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 35b4c49..14879c2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -25828,7 +25828,8 @@ ix86_rtx_costs (rtx x, int code, int outer_code_i, int
*total, bool speed)
return false;
case FLOAT_EXTEND:
- if (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH))
+ if (!(SSE_FLOAT_MODE_P (mode)
+ && (TARGET_SSE_MATH || TARGET_SSEREGPARM)))
*total = 0;
return false;
--
-msseregparm is very similar to -mfpmath=sse for function parameters.
Personally, I think we should allow -msseregparm only if -mfpmath=sse
is used.
---
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 35b4c49..9f6d947 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3306,10 +3306,11 @@ override_options (bool main_args_p)
}
}
- /* Accept -msseregparm only if at least SSE support is enabled. */
+ /* Accept -msseregparm only if at least SSE fpmath support is enabled. */
if (TARGET_SSEREGPARM
- && ! TARGET_SSE)
- error ("%ssseregparm%s used without SSE enabled", prefix, suffix);
+ && ! TARGET_SSE_MATH)
+ error ("%ssseregparm%s used without SSE fpmath enabled",
+ prefix, suffix);
ix86_fpmath = TARGET_FPMATH_DEFAULT;
if (ix86_fpmath_string != 0)
@@ -4620,16 +4621,16 @@ ix86_function_sseregparm (const_tree type, const_tree
decl, bool warn)
if (TARGET_SSEREGPARM
|| (type && lookup_attribute ("sseregparm", TYPE_ATTRIBUTES (type))))
{
- if (!TARGET_SSE)
+ if (!TARGET_SSEREGPARM)
{
if (warn)
{
if (decl)
error ("Calling %qD with attribute sseregparm without "
- "SSE/SSE2 enabled", decl);
+ "SSE fpmath enabled", decl);
else
error ("Calling %qT with attribute sseregparm without "
- "SSE/SSE2 enabled", type);
+ "SSE fpmath enabled", type);
}
return 0;
}
--
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl dot tools at gmail dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43546