+2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/30949
+ * c-typeck.c (convert_for_assignment): Do not give declaration's
+ location for builtins. Spell out which type was expected and which
+ was given.
+
2008-10-22 Nick Clifton <nickc@redhat.com>
* config/frv/frv.h (HARD_REGNO_RENAME_OK): Define. Do not allow
{ \
case ic_argpass: \
if (pedwarn (LOCATION, OPT, AR, parmnum, rname)) \
- inform (fundecl ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \
+ inform ((fundecl && !DECL_IS_BUILTIN (fundecl)) \
+ ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \
"expected %qT but argument is of type %qT", \
type, rhstype); \
break; \
/* ??? This should not be an error when inlining calls to
unprototyped functions. */
error ("incompatible type for argument %d of %qE", parmnum, rname);
+ inform ((fundecl && !DECL_IS_BUILTIN (fundecl))
+ ? DECL_SOURCE_LOCATION (fundecl) : input_location,
+ "expected %qT but argument is of type %qT", type, rhstype);
break;
case ic_assign:
- error ("incompatible types in assignment");
+ error ("incompatible types when assigning to type %qT from type %qT",
+ type, rhstype);
break;
case ic_init:
- error ("incompatible types in initialization");
+ error ("incompatible types when initializing type %qT using type %qT",
+ type, rhstype);
break;
case ic_return:
- error ("incompatible types in return");
+ error ("incompatible types when returning type %qT but %qT was expected",
+ rhstype, type);
break;
default:
gcc_unreachable ();
+2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/30949
+ * gcc.target/i386/sse-vect-types.c: Update.
+ * gcc.dg/simd-5.c: Update.
+ * gcc.dg/assign-warn-2.c: Update.
+ * gcc.dg/simd-2.c: Update.
+ * gcc.dg/simd-6.c: Update.
+ * gcc.dg/assign-warn-1.c: Update.
+ * gcc.dg/dfp/composite-type.c: Update.
+ * gcc.dg/simd-1.c: Update.
+ * gcc.dg/pr36997.c: Update.
+
2008-10-21 Paul Thomas <pault@gcc.gnu.org>
PR libfortran/36795
TESTARG(stria, struct s, int); /* { dg-error "incompatible type for argument 1 of 'striaF'" } */
TESTARP(strib, struct s, int); /* { dg-error "incompatible type for argument 1 of 'stribFp.x'" } */
-TESTASS(stric, struct s, int); /* { dg-error "incompatible types in assignment" } */
+TESTASS(stric, struct s, int); /* { dg-error "incompatible types when assigning to type 'struct s' from type 'int'" } */
TESTINI(strid, struct s, int); /* { dg-error "invalid initializer" } */
-TESTRET(strie, struct s, int); /* { dg-error "incompatible types in return" } */
+TESTRET(strie, struct s, int); /* { dg-error "incompatible types when returning type 'int' but 'struct s' was expected" } */
TESTARG(istra, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istraF'" } */
+
TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istrbFp.x'" } */
-TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */
-TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */
-TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */
+
+TESTASS(istrc, int, struct s); /* { dg-error "incompatible types when assigning to type 'int' from type 'struct s'" } */
+TESTINI(istrd, int, struct s); /* { dg-error "incompatible types when initializing type 'int' using type 'struct s'" } */
+TESTRET(istre, int, struct s); /* { dg-error "incompatible types when returning type 'struct s' but 'int' was expected" } */
/* Match all extra informative notes. */
/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
TESTARG(stria, struct s, int); /* { dg-error "incompatible type for argument 1 of 'striaF'" } */
TESTARP(strib, struct s, int); /* { dg-error "incompatible type for argument 1 of 'stribFp.x'" } */
-TESTASS(stric, struct s, int); /* { dg-error "incompatible types in assignment" } */
+TESTASS(stric, struct s, int); /* { dg-error "incompatible types when assigning to type 'struct s' from type 'int'" } */
TESTINI(strid, struct s, int); /* { dg-error "invalid initializer" } */
-TESTRET(strie, struct s, int); /* { dg-error "incompatible types in return" } */
+TESTRET(strie, struct s, int); /* { dg-error "incompatible types when returning type 'int' but 'struct s' was expected" } */
TESTARG(istra, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istraF'" } */
TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istrbFp.x'" } */
-TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */
-TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */
-TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */
+TESTASS(istrc, int, struct s); /* { dg-error "incompatible types when assigning to type 'int' from type 'struct s'" } */
+TESTINI(istrd, int, struct s); /* { dg-error "incompatible types when initializing type 'int' using type 'struct s'" } */
+TESTRET(istre, int, struct s); /* { dg-error "incompatible types when returning type 'struct s' but 'int' was expected" } */
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 0 } */
d##TYPE = f2_##TYPE(h3_##TYPE); \
} while(0)
-DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types in assignment" } */
+DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 35 } */
-DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types in assignment" } */
+DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 39 } */
-DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types in assignment" } */
+DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 43 } */
__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
{
return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
+ /* { dg-message "note: expected 'long long int __vector__' but argument is of type 'long long int'" "" { target *-*-* } 7 } */
}
a = b;
/* Assignment of different types. */
- b = c; /* { dg-error "incompatible types in assignment" } */
- d = a; /* { dg-error "incompatible types in assignment" } */
+ b = c; /* { dg-error "incompatible types when assigning" } */
+ d = a; /* { dg-error "incompatible types when assigning" } */
/* Casting between SIMDs of the same size. */
e = (typeof (e)) a;
/* Different signed SIMD assignment. */
f = a; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
- /* { dg-error "incompatible types in assignment" "" { target *-*-* } 35 } */
+ /* { dg-error "incompatible types when assigning" "" { target *-*-* } 35 } */
/* Casted different signed SIMD assignment. */
f = (uv4si) a;
/* Assignment between scalar and SIMD of different size. */
- foo = a; /* { dg-error "incompatible types in assignment" } */
+ foo = a; /* { dg-error "incompatible types when assigning" } */
/* Casted assignment between scalar and SIMD of same size. */
foo = (typeof (foo)) foo2;
a = b;
/* Assignment of different types. */
- b = c; /* { dg-error "incompatible types in assignment" } */
- d = a; /* { dg-error "incompatible types in assignment" } */
+ b = c; /* { dg-error "incompatible types when assigning" } */
+ d = a; /* { dg-error "incompatible types when assigning" } */
/* Casting between SIMDs of the same size. */
e = (typeof (e)) a;
/* Assignment between scalar and SIMD of different size. */
- foo = a; /* { dg-error "incompatible types in assignment" } */
+ foo = a; /* { dg-error "incompatible types when assigning" } */
/* Casted assignment between scalar and SIMD of same size. */
foo = (typeof (foo)) foo2; /* { dg-error "aggregate value used where a float was expected" } */
#define vector __attribute__ ((vector_size (8)))
vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
vector char y = (vector short) {1,2,3,4}; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
- /* { dg-error "incompatible types in initialization" "" { target *-*-* } 7 } */
+ /* { dg-error "incompatible types when initializing" "" { target *-*-* } 7 } */
#define vector __attribute__ ((vector_size (8)))
vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
vector char y = (vector short) {1,2,3,4}; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
- /* { dg-error "incompatible types in initialization" "" { target *-*-* } 7 } */
+ /* { dg-error "incompatible types when initializing" "" { target *-*-* } 7 } */
}
return a;
}
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 0 } */