* [RTL/C FE] banish RTL from the C FE
@ 2010-07-01 14:15 Manuel López-Ibáñez
2010-07-01 18:44 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: Manuel López-Ibáñez @ 2010-07-01 14:15 UTC (permalink / raw)
To: Gcc Patch List; +Cc: Joseph S. Myers, Diego Novillo, Steven Bosscher
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
Hi,
This patch removes the last bit of RTL (as far as I can see) from the
C/C++ FEs. Bootstrapped on x86_64-linux with enable-languages=all,ada
after the mem-ref2 merge.
OK?
2010-07-01 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-family/c-common.c (IN_GCC_FRONTEND): Do not undef.
Do not include expr.h
(vector_mode_valid_p): Move here.
* expr.c (vector_mode_valid_p): Move to c-common.c.
* expr.h (vector_mode_valid_p): Do not declare here.
* system.h: Poison GCC_EXPR_H in front-ends.
Manuel.
[-- Attachment #2: poison-expr.diff --]
[-- Type: text/plain, Size: 5013 bytes --]
Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c (revision 161658)
+++ gcc/c-family/c-common.c (working copy)
@@ -17,14 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* FIXME: Still need to include rtl.h here (via expr.h) in a front-end file.
- Pretend this is a back-end file. */
-#undef IN_GCC_FRONTEND
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "intl.h"
@@ -48,12 +44,10 @@ along with GCC; see the file COPYING3.
#include "opts.h"
#include "cgraph.h"
#include "target-def.h"
#include "libfuncs.h"
-#include "expr.h" /* For vector_mode_valid_p */
-
cpp_reader *parse_in; /* Declared in c-pragma.h. */
/* The following symbols are subsumed in the c_global_trees array, and
listed here individually for documentation purposes.
@@ -6247,10 +6241,44 @@ handle_destructor_attribute (tree *node,
}
return NULL_TREE;
}
+/* Nonzero if the mode is a valid vector mode for this architecture.
+ This returns nonzero even if there is no hardware support for the
+ vector mode, but we can emulate with narrower modes. */
+
+static int
+vector_mode_valid_p (enum machine_mode mode)
+{
+ enum mode_class mclass = GET_MODE_CLASS (mode);
+ enum machine_mode innermode;
+
+ /* Doh! What's going on? */
+ if (mclass != MODE_VECTOR_INT
+ && mclass != MODE_VECTOR_FLOAT
+ && mclass != MODE_VECTOR_FRACT
+ && mclass != MODE_VECTOR_UFRACT
+ && mclass != MODE_VECTOR_ACCUM
+ && mclass != MODE_VECTOR_UACCUM)
+ return 0;
+
+ /* Hardware support. Woo hoo! */
+ if (targetm.vector_mode_supported_p (mode))
+ return 1;
+
+ innermode = GET_MODE_INNER (mode);
+
+ /* We should probably return 1 if requesting V4DI and we have no DI,
+ but we have V2DI, but this is probably very unlikely. */
+
+ /* If we have support for the inner mode, we can safely emulate it.
+ We may not have V2DI, but me can emulate with a pair of DIs. */
+ return targetm.scalar_mode_supported_p (innermode);
+}
+
+
/* Handle a "mode" attribute; arguments as in
struct attribute_spec.handler. */
static tree
handle_mode_attribute (tree *node, tree name, tree args,
Index: gcc/expr.c
===================================================================
--- gcc/expr.c (revision 161658)
+++ gcc/expr.c (working copy)
@@ -10293,43 +10293,10 @@ try_tablejump (tree index_type, tree ind
TYPE_UNSIGNED (TREE_TYPE (range))),
table_label, default_label);
return 1;
}
-/* Nonzero if the mode is a valid vector mode for this architecture.
- This returns nonzero even if there is no hardware support for the
- vector mode, but we can emulate with narrower modes. */
-
-int
-vector_mode_valid_p (enum machine_mode mode)
-{
- enum mode_class mclass = GET_MODE_CLASS (mode);
- enum machine_mode innermode;
-
- /* Doh! What's going on? */
- if (mclass != MODE_VECTOR_INT
- && mclass != MODE_VECTOR_FLOAT
- && mclass != MODE_VECTOR_FRACT
- && mclass != MODE_VECTOR_UFRACT
- && mclass != MODE_VECTOR_ACCUM
- && mclass != MODE_VECTOR_UACCUM)
- return 0;
-
- /* Hardware support. Woo hoo! */
- if (targetm.vector_mode_supported_p (mode))
- return 1;
-
- innermode = GET_MODE_INNER (mode);
-
- /* We should probably return 1 if requesting V4DI and we have no DI,
- but we have V2DI, but this is probably very unlikely. */
-
- /* If we have support for the inner mode, we can safely emulate it.
- We may not have V2DI, but me can emulate with a pair of DIs. */
- return targetm.scalar_mode_supported_p (innermode);
-}
-
/* Return a CONST_VECTOR rtx for a VECTOR_CST tree. */
static rtx
const_vector_from_tree (tree exp)
{
rtvec v;
Index: gcc/expr.h
===================================================================
--- gcc/expr.h (revision 161658)
+++ gcc/expr.h (working copy)
@@ -690,8 +690,6 @@ extern rtx set_user_assembler_libfunc (c
extern tree build_libfunc_function (const char *);
/* Get the personality libfunc for a function decl. */
rtx get_personality_function (tree);
-extern int vector_mode_valid_p (enum machine_mode);
-
#endif /* GCC_EXPR_H */
Index: gcc/system.h
===================================================================
--- gcc/system.h (revision 161658)
+++ gcc/system.h (working copy)
@@ -798,11 +798,11 @@ extern void fancy_abort (const char *, i
#endif /* IN_GCC */
/* Front ends should never have to include middle-end headers. Enforce
this by poisoning the header double-include protection defines. */
#ifdef IN_GCC_FRONTEND
-#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H
+#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H GCC_EXPR_H
#endif
/* Note: not all uses of the `index' token (e.g. variable names and
structure members) have been eliminated. */
#undef bcopy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RTL/C FE] banish RTL from the C FE
2010-07-01 14:15 [RTL/C FE] banish RTL from the C FE Manuel López-Ibáñez
@ 2010-07-01 18:44 ` Richard Henderson
2010-07-03 21:18 ` Manuel López-Ibáñez
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2010-07-01 18:44 UTC (permalink / raw)
To: Manuel López-Ibáñez
Cc: Gcc Patch List, Joseph S. Myers, Diego Novillo, Steven Bosscher
On 07/01/2010 07:15 AM, Manuel López-Ibáñez wrote:
> Hi,
>
> This patch removes the last bit of RTL (as far as I can see) from the
> C/C++ FEs. Bootstrapped on x86_64-linux with enable-languages=all,ada
> after the mem-ref2 merge.
>
> OK?
>
> 2010-07-01 Manuel López-Ibáñez <manu@gcc.gnu.org>
>
> * c-family/c-common.c (IN_GCC_FRONTEND): Do not undef.
> Do not include expr.h
> (vector_mode_valid_p): Move here.
> * expr.c (vector_mode_valid_p): Move to c-common.c.
> * expr.h (vector_mode_valid_p): Do not declare here.
> * system.h: Poison GCC_EXPR_H in front-ends.
Ok.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RTL/C FE] banish RTL from the C FE
2010-07-01 18:44 ` Richard Henderson
@ 2010-07-03 21:18 ` Manuel López-Ibáñez
0 siblings, 0 replies; 3+ messages in thread
From: Manuel López-Ibáñez @ 2010-07-03 21:18 UTC (permalink / raw)
To: Richard Henderson
Cc: Gcc Patch List, Joseph S. Myers, Diego Novillo, Steven Bosscher
On 1 July 2010 20:43, Richard Henderson <rth@redhat.com> wrote:
> On 07/01/2010 07:15 AM, Manuel López-Ibáńez wrote:
>> Hi,
>>
>> This patch removes the last bit of RTL (as far as I can see) from the
>> C/C++ FEs. Bootstrapped on x86_64-linux with enable-languages=all,ada
>> after the mem-ref2 merge.
>>
>> OK?
>>
>> 2010-07-01 Manuel López-Ibáńez <manu@gcc.gnu.org>
>>
>> * c-family/c-common.c (IN_GCC_FRONTEND): Do not undef.
>> Do not include expr.h
>> (vector_mode_valid_p): Move here.
>> * expr.c (vector_mode_valid_p): Move to c-common.c.
>> * expr.h (vector_mode_valid_p): Do not declare here.
>> * system.h: Poison GCC_EXPR_H in front-ends.
>
> Ok.
Thanks,
Committed revision 161785.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-03 21:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-01 14:15 [RTL/C FE] banish RTL from the C FE Manuel López-Ibáñez
2010-07-01 18:44 ` Richard Henderson
2010-07-03 21:18 ` Manuel López-Ibáñez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).