aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r--gcc/config/i386/i386.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 47a28055cab..f4e971d2860 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -20714,13 +20714,13 @@ ix86_split_idivmod (machine_mode mode, rtx operands[],
if (signed_p)
{
- div = gen_rtx_DIV (SImode, operands[2], operands[3]);
- mod = gen_rtx_MOD (SImode, operands[2], operands[3]);
+ div = gen_rtx_DIV (mode, operands[2], operands[3]);
+ mod = gen_rtx_MOD (mode, operands[2], operands[3]);
}
else
{
- div = gen_rtx_UDIV (SImode, operands[2], operands[3]);
- mod = gen_rtx_UMOD (SImode, operands[2], operands[3]);
+ div = gen_rtx_UDIV (mode, operands[2], operands[3]);
+ mod = gen_rtx_UMOD (mode, operands[2], operands[3]);
}
/* Extract remainder from AH. */
@@ -32845,6 +32845,9 @@ sorted_attr_string (tree arglist)
{
const char *str = TREE_STRING_POINTER (TREE_VALUE (arg));
size_t len = strlen (str);
+ /* Skip empty string. */
+ if (len == 0)
+ continue;
str_len_sum += len + 1;
if (arg != arglist)
argnum++;
@@ -32859,11 +32862,21 @@ sorted_attr_string (tree arglist)
{
const char *str = TREE_STRING_POINTER (TREE_VALUE (arg));
size_t len = strlen (str);
+ /* Skip empty string. */
+ if (len == 0)
+ continue;
memcpy (attr_str + str_len_sum, str, len);
attr_str[str_len_sum + len] = TREE_CHAIN (arg) ? ',' : '\0';
str_len_sum += len + 1;
}
+ /* Strip ',' character at the end. */
+ if (str_len_sum > 0 && attr_str[str_len_sum - 1] == ',')
+ {
+ attr_str[str_len_sum - 1] = '\0';
+ str_len_sum--;
+ }
+
/* Replace "=,-" with "_". */
for (i = 0; i < strlen (attr_str); i++)
if (attr_str[i] == '=' || attr_str[i]== '-')
@@ -33483,6 +33496,7 @@ fold_builtin_cpu (tree fndecl, tree *args)
M_INTEL_KNL,
M_AMD_BTVER1,
M_AMD_BTVER2,
+ M_AMDFAM17H,
M_CPU_SUBTYPE_START,
M_INTEL_COREI7_NEHALEM,
M_INTEL_COREI7_WESTMERE,
@@ -33537,6 +33551,7 @@ fold_builtin_cpu (tree fndecl, tree *args)
{"bdver3", M_AMDFAM15H_BDVER3},
{"bdver4", M_AMDFAM15H_BDVER4},
{"btver2", M_AMD_BTVER2},
+ {"amdfam17h", M_AMDFAM17H},
{"znver1", M_AMDFAM17H_ZNVER1},
};