PR libstdc++/86450 use -Wabi=2 and simplify -Werror use
[official-gcc.git] / gcc / generic-match-head.c
blobf7b6b1f23c58d92fda6f6b9f36da7b35778e028f
1 /* Preamble and helpers for the autogenerated generic-match.c file.
2 Copyright (C) 2014-2018 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #include "config.h"
21 #include "system.h"
22 #include "coretypes.h"
23 #include "backend.h"
24 #include "target.h"
25 #include "rtl.h"
26 #include "tree.h"
27 #include "gimple.h"
28 #include "ssa.h"
29 #include "cgraph.h"
30 #include "fold-const.h"
31 #include "stor-layout.h"
32 #include "tree-dfa.h"
33 #include "builtins.h"
34 #include "case-cfn-macros.h"
35 #include "gimplify.h"
36 #include "optabs-tree.h"
39 /* Routine to determine if the types T1 and T2 are effectively
40 the same for GENERIC. If T1 or T2 is not a type, the test
41 applies to their TREE_TYPE. */
43 static inline bool
44 types_match (tree t1, tree t2)
46 if (!TYPE_P (t1))
47 t1 = TREE_TYPE (t1);
48 if (!TYPE_P (t2))
49 t2 = TREE_TYPE (t2);
51 return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2);
54 /* Return if T has a single use. For GENERIC, we assume this is
55 always true. */
57 static inline bool
58 single_use (tree t ATTRIBUTE_UNUSED)
60 return true;
63 /* Return true if math operations should be canonicalized,
64 e.g. sqrt(sqrt(x)) -> pow(x, 0.25). */
66 static inline bool
67 canonicalize_math_p ()
69 return true;
72 /* Return true if math operations that are beneficial only after
73 vectorization should be canonicalized. */
75 static inline bool
76 canonicalize_math_after_vectorization_p ()
78 return false;