public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Disable Ada front-end checking in release mode
@ 2013-01-11  9:11 Eric Botcazou
  2013-01-11 10:33 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2013-01-11  9:11 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Hi,

the Ada part of the Ada front-end is compiled with -gnata, which boils down to 
a form of dynamic type checking for the AST, i.e. something roughly equivalent 
to Tree checking for the front-ends of the C family of compilers.  This patch 
aligns the Ada compiler with them by disabling it in --enable-checking=release 
mode.  Issues flagged by this checking are usually benign on release branches 
and gigi has a slew of gcc_assert's that stop the compiler in serious cases.

Bootstrapped on x86_64-suse-linux (w and w/o --enable-checking=release), OK 
for the mainline?


2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>

	* Makefile.tpl (BOOT_ADAFLAGS): Remove -gnata.
	* Makefile.in: Regenerate.


gcc/
2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>

	* configure.ac (Tree checking): Set TREECHECKING to yes if enabled.
	Substitute TREECHECKING.
	* configure: Regenerate.
	* Makefile.in (TREECHECKING): New.


gcc/ada/
2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/Make-lang.in (COMMON_ADAFLAGS): Remove -gnata.
	(CHECKING_ADAFLAGS): New.
	(ALL_ADAFLAGS): Include CHECKING_ADAFLAGS.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 2641 bytes --]

Index: gcc/ada/gcc-interface/Make-lang.in
===================================================================
--- gcc/ada/gcc-interface/Make-lang.in	(revision 195091)
+++ gcc/ada/gcc-interface/Make-lang.in	(working copy)
@@ -45,7 +45,12 @@ RMDIR = rm -rf
 \f
 
 # Extra flags to pass to recursive makes.
-COMMON_ADAFLAGS= -gnatpg -gnata
+COMMON_ADAFLAGS= -gnatpg
+ifeq ($(TREECHECKING),)
+CHECKING_ADAFLAGS=
+else
+CHECKING_ADAFLAGS= -gnata
+endif
 WARN_ADAFLAGS= -W -Wall
 
 # For native builds, the base compiler might be old and we need to arrange for
@@ -59,7 +64,8 @@ else
 ADAFLAGS= $(COMMON_ADAFLAGS)
 endif
 
-ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS) $(WARN_ADAFLAGS)
+ALL_ADAFLAGS = \
+  $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS) $(CHECKING_ADAFLAGS) $(WARN_ADAFLAGS)
 FORCE_DEBUG_ADAFLAGS = -g
 ADA_CFLAGS =
 ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 195012)
+++ gcc/configure.ac	(working copy)
@@ -471,6 +471,7 @@ if test x$ac_tree_checking != x ; then
    routines will also be enabled by this option.
    ])
   TREEBROWSER=tree-browser.o
+  TREECHECKING=yes
 fi
 if test x$ac_types_checking != x ; then
   AC_DEFINE(ENABLE_TYPES_CHECKING, 1,
@@ -479,6 +480,7 @@ if test x$ac_types_checking != x ; then
    ])
 fi
 AC_SUBST(TREEBROWSER)
+AC_SUBST(TREECHECKING)
 if test x$ac_rtl_checking != x ; then
   AC_DEFINE(ENABLE_RTL_CHECKING, 1,
 [Define if you want all operations on RTL (the basic data structure
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 195012)
+++ gcc/Makefile.in	(working copy)
@@ -1487,6 +1487,10 @@ ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS
 BACKEND = libbackend.a main.o @TREEBROWSER@ libcommon-target.a libcommon.a \
 	$(CPPLIB) $(LIBDECNUMBER)
 
+# This is defined to "yes" if Tree checking is enabled, which roughly means
+# front-end checking.
+TREECHECKING = @TREECHECKING@
+
 MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
  insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 195012)
+++ Makefile.tpl	(working copy)
@@ -367,7 +367,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
 # here so that they can be overridden by Makefile fragments.
 BOOT_CFLAGS= -g -O2
 BOOT_LDFLAGS=
-BOOT_ADAFLAGS=-gnatpg -gnata
+BOOT_ADAFLAGS= -gnatpg
 
 AWK = @AWK@
 SED = @SED@

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Disable Ada front-end checking in release mode
  2013-01-11  9:11 [patch] Disable Ada front-end checking in release mode Eric Botcazou
@ 2013-01-11 10:33 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2013-01-11 10:33 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Fri, Jan 11, 2013 at 10:08 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> the Ada part of the Ada front-end is compiled with -gnata, which boils down to
> a form of dynamic type checking for the AST, i.e. something roughly equivalent
> to Tree checking for the front-ends of the C family of compilers.  This patch
> aligns the Ada compiler with them by disabling it in --enable-checking=release
> mode.  Issues flagged by this checking are usually benign on release branches
> and gigi has a slew of gcc_assert's that stop the compiler in serious cases.
>
> Bootstrapped on x86_64-suse-linux (w and w/o --enable-checking=release), OK
> for the mainline?

Ok.

Thanks,
Richard.

>
> 2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * Makefile.tpl (BOOT_ADAFLAGS): Remove -gnata.
>         * Makefile.in: Regenerate.
>
>
> gcc/
> 2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * configure.ac (Tree checking): Set TREECHECKING to yes if enabled.
>         Substitute TREECHECKING.
>         * configure: Regenerate.
>         * Makefile.in (TREECHECKING): New.
>
>
> gcc/ada/
> 2013-01-11  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * gcc-interface/Make-lang.in (COMMON_ADAFLAGS): Remove -gnata.
>         (CHECKING_ADAFLAGS): New.
>         (ALL_ADAFLAGS): Include CHECKING_ADAFLAGS.
>
>
> --
> Eric Botcazou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-11 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11  9:11 [patch] Disable Ada front-end checking in release mode Eric Botcazou
2013-01-11 10:33 ` Richard Biener

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).