]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR tree-optimization/69156
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jan 2016 19:21:59 +0000 (19:21 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jan 2016 19:21:59 +0000 (19:21 +0000)
* gimple.c (validate_type): Removed.
(gimple_builtin_call_types_compatible_p): Use
useless_type_conversion_p instead of validate_type.
* value-prof.c (gimple_stringop_fixed_value): Fold
icall_size to correct type.

* gcc.dg/pr69156.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232342 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr69156.c [new file with mode: 0644]
gcc/value-prof.c

index a759568a64bca6c3c000b8b3f4833cca208f24f2..c6ae288aa809a9abae9ce63774b4cbbd4ac9fd06 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/69156
+       * gimple.c (validate_type): Removed.
+       (gimple_builtin_call_types_compatible_p): Use
+       useless_type_conversion_p instead of validate_type.
+       * value-prof.c (gimple_stringop_fixed_value): Fold
+       icall_size to correct type.
+
 2016-01-13  Jonathan Wakely  <jwakely@redhat.com>
 
        * doc/extend.texi (__atomic Builtins): Clarify compare_exchange
@@ -47,7 +56,7 @@
        * config/arm/arm-arches.def: Remove spurious whitespace in "armv8.1-a"
        and "armv8.1-a+crc" entries.
 
-2016-01-13  Alexander Fomin <alexander.fomin@intel.com>
+2016-01-13  Alexander Fomin  <alexander.fomin@intel.com>
 
        PR target/69228
        * config/i386/sse.md (define_expand "avx512pf_gatherpf<mode>sf"):
        (compute_path_counts): Only do count adjustment when it's really
        needed.
 
-2016-01-12  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-12  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/invoke.texi (Spec Files): Move section down in file, past
        all command-line option descriptions.
        (walk_type): Likewise.
        (write_func_for_structure): Likewise.
 
-2016-01-12  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-12  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/invoke.texi (Option Summary) Move -no-canonical-prefixes to
        Directory Options, and -specs= to Overall Options.
        * tree-vrp.c (adjust_range_with_scev): Check overflow in range
        information computed for expression "init + nit * step".
 
-2016-01-12  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-12  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/invoke.texi (Invoking GCC): Copy-edit.  Incorporate information
        about name of GCC executable.  Remove deleted node from menu.
        for permuted strided SLP loads and do not spuriously assign
        to SLP_TREE_VEC_STMTS.
 
-2016-01-12  Andris Pavenis <andris.pavenis@iki.fi>
+2016-01-12  Andris Pavenis  <andris.pavenis@iki.fi>
 
        * config/i386/djgpp.h (PREFERRED_DEBUGGING_TYPE): Define to DWARF2
        (TARGET_ASM_OUTPUT_IDENT): Define to default_asm_output_ident_directive
        * ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Limit number of
        conditionl moves.
 
-2016-01-11  Alexandre Oliva <aoliva@redhat.com>
+2016-01-11  Alexandre Oliva  <aoliva@redhat.com>
 
        PR bootstrap/69123
        * var-tracking.c (drop_overlapping_mem_locs): Operate on all
        depending on frame_pointer_needed before remaining integer and SSE
        registers are saved.
 
-2016-01-07  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-07  Sandra Loosemore  <sandra@codesourcery.com>
 
        PR 1078
        * doc/extend.texi (Nvidia PDX Function Attributes): New section.
        EXPR instead of ARG.
        * ubsan.h (ubsan_instrument_float_cast): Adjust declaration.
 
-2016-01-05  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        PR 1078
        * doc/extend.texi (RL78 Variable Attributes): New section.
        * config/i386/sse.md: Replace xm with xBm in plusminus and
        any_logic patterns.
 
-2016-01-05  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        PR 1078
        * doc/extend.texi (V850 Function Attributes): New section.
        (V850 Variable Attributes): New section.
 
-2016-01-05  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        PR 1078
        * doc/extend.texi (MicroBlaze Function Attributes): Document
        interrupt_handler and fast_interrupt attributes.
 
-2016-01-05  Sergei Trofimovich <siarheit@google.com>
+2016-01-05  Sergei Trofimovich  <siarheit@google.com>
 
        PR other/60465
        * config/ia64/ia64.c (ia64_expand_load_address): Use gprel64
        * doc/install.texi (--with-multilib-list): Describe the meaning of the
        option for arm*-*-* targets.
 
-2016-01-03  Sandra Loosemore <sandra@codesourcery.com>
+2016-01-03  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/extend.texi (Common Function Attributes): Move docs for
        MSP430-specific attributes to....
        entries and add a cross-reference to the corresponding function
        attribute docs.
 
-2016-01-03  Vladimír Čunát <vcunat@gmail.com>
+2016-01-03  Vladimír Čunát  <vcunat@gmail.com>
 
        * doc/invoke.texi (RS/6000 and PowerPC Options): Fix
        -finite-math typo.
index f312f905dec834e63f2ff8ace8fc40ab30439caf..ff3c68a47febb652a8f1985a88d36b2c04fde9cf 100644 (file)
@@ -2445,24 +2445,6 @@ gimple_ior_addresses_taken (bitmap addresses_taken, gimple *stmt)
 }
 
 
-/* Return true if TYPE1 and TYPE2 are compatible enough for builtin
-   processing.  */
-
-static bool
-validate_type (tree type1, tree type2)
-{
-  if (INTEGRAL_TYPE_P (type1)
-      && INTEGRAL_TYPE_P (type2))
-    ;
-  else if (POINTER_TYPE_P (type1)
-          && POINTER_TYPE_P (type2))
-    ;
-  else if (TREE_CODE (type1)
-          != TREE_CODE (type2))
-    return false;
-  return true;
-}
-
 /* Return true when STMTs arguments and return value match those of FNDECL,
    a decl of a builtin function.  */
 
@@ -2473,7 +2455,8 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl)
 
   tree ret = gimple_call_lhs (stmt);
   if (ret
-      && !validate_type (TREE_TYPE (ret), TREE_TYPE (TREE_TYPE (fndecl))))
+      && !useless_type_conversion_p (TREE_TYPE (ret),
+                                    TREE_TYPE (TREE_TYPE (fndecl))))
     return false;
 
   tree targs = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
@@ -2484,7 +2467,7 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl)
       if (!targs)
        return true;
       tree arg = gimple_call_arg (stmt, i);
-      if (!validate_type (TREE_TYPE (arg), TREE_VALUE (targs)))
+      if (!useless_type_conversion_p (TREE_VALUE (targs), TREE_TYPE (arg)))
        return false;
       targs = TREE_CHAIN (targs);
     }
index e896dcd5ea1ce62d4f420c04bd332e01381b881d..dff8d6988dc103f69dfd8f044b65a714f9bed8fb 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/69156
+       * gcc.dg/pr69156.c: New test.
+
 2016-01-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/pr69225-7.c: New test.
@@ -19,7 +24,7 @@
        PR tree-optimization/69169
        * gcc.dg/pr69169.c: New test.
 
-2016-01-13  Alexander Fomin <alexander.fomin@intel.com>
+2016-01-13  Alexander Fomin  <alexander.fomin@intel.com>
 
        PR target/69228
        * gcc.target/i386/avx512pf-vscatterpf0dpd-1.c: Adjust.
        for ix86 targets.
        * gcc.dg/ifcvt-5.c: New test.
 
-2016-01-11  Alexandre Oliva <aoliva@redhat.com>
+2016-01-11  Alexandre Oliva  <aoliva@redhat.com>
 
        PR bootstrap/69123
        * g++.dg/pr69123.C: New.
        * g++.dg/pr66655_1.cc: Test support file.
        * g++.dg/pr66655.h: Test header file.
 
-2016-01-07  Dominique d'Humieres <dominiq@lps.ens.fr>
+2016-01-07  Dominique d'Humieres  <dominiq@lps.ens.fr>
 
        PR fortran/66680
        gfortran.dg/gomp/pr66680.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/pr69156.c b/gcc/testsuite/gcc.dg/pr69156.c
new file mode 100644 (file)
index 0000000..b22aaec
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR tree-optimization/69156 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-ccp" } */
+
+_Bool
+foo ()
+{
+  _Bool (*f) () = __builtin_abs;       /* { dg-warning "initialization from incompatible pointer type" } */
+  return f (0);
+}
index 336b8aee882932d96afffec180ce9fa911a1a820..f9574b679bd6e3dcefaec2d806f70be1530c9386 100644 (file)
@@ -1697,7 +1697,8 @@ gimple_stringop_fixed_value (gcall *vcall_stmt, tree icall_size, int prob,
   gimple_set_vuse (vcall_stmt, NULL);
   update_stmt (vcall_stmt);
   icall_stmt = as_a <gcall *> (gimple_copy (vcall_stmt));
-  gimple_call_set_arg (icall_stmt, size_arg, icall_size);
+  gimple_call_set_arg (icall_stmt, size_arg,
+                      fold_convert (optype, icall_size));
   gsi_insert_before (&gsi, icall_stmt, GSI_SAME_STMT);
 
   /* Fix CFG. */