+2017-09-13 Marek Polacek <polacek@redhat.com>
+
+ PR c/82167
+ * c-typeck.c (c_expr_sizeof_expr): Use the type of expr.value rather
+ than expr.original_type.
+
2017-09-12 Nathan Sidwell <nathan@acm.org>
* c-decl.c (field_decl_cmp, resort_data, resort_field_decl_cmp,
if (warning_at (loc, OPT_Wsizeof_array_argument,
"%<sizeof%> on array function parameter %qE will "
"return size of %qT", expr.value,
- expr.original_type))
+ TREE_TYPE (expr.value)))
inform (DECL_SOURCE_LOCATION (expr.value), "declared here");
}
tree folded_expr = c_fully_fold (expr.value, require_constant_value,
+2017-09-13 Marek Polacek <polacek@redhat.com>
+
+ PR c/82167
+ * gcc.dg/pr82167.c: New test.
+
2017-09-13 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-ld-char.c: New.
--- /dev/null
+/* PR c/82167 */
+/* { dg-do compile } */
+
+void
+fn1 (int a[])
+{
+ __builtin_printf ("%zu\n", sizeof (*&a)); /* { dg-warning ".sizeof. on array function parameter .a. will return size of .int \\*." } */
+}
+
+void
+fn2 (int *a[])
+{
+ __builtin_printf ("%zu\n", sizeof (*&a)); /* { dg-warning ".sizeof. on array function parameter .a. will return size of .int \\*\\*." } */
+}