OSDN Git Service

pf3gnuchains/gcc-fork.git
15 years agoconfig: sync with src
bonzini [Wed, 30 Jul 2008 14:57:07 +0000 (14:57 +0000)]
config: sync with src
2008-07-25  Keith Seitz  <keiths@redhat.com>

* acinclude.m4: Remove libide, libgui, and all the other Tcl
functions.
* tcl.m4: New file.

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

15 years ago2008-07-30 Rafael Avila de Espindola <espindola@google.com>
espindola [Wed, 30 Jul 2008 13:59:58 +0000 (13:59 +0000)]
2008-07-30  Rafael Avila de Espindola  <espindola@google.com>

       * final.c (call_from_call_insn): New.
       (final_scan_insn): Call assemble_external on FUNCTION_DECLs.

2008-07-30  Rafael Avila de Espindola  <espindola@google.com>

* gcc.dg/visibility-14.c: New test.
* gcc.dg/visibility-15.c: New test.
* gcc.dg/visibility-16.c: New test.
* gcc.dg/visibility-17.c: New test.
* gcc.dg/visibility-18.c: New test.
* gcc.dg/visibility-19.c: New test.

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

15 years ago2008-07-30 Dodji Seketeli <dseketel@redhat.com>
dodji [Wed, 30 Jul 2008 13:07:50 +0000 (13:07 +0000)]
2008-07-30  Dodji Seketeli  <dseketel@redhat.com>

PR c++/36767
* decl2.c (fix_temporary_vars_context_r): New function.
 (one_static_initialization_or_destruction): Make sure temporary
 variables part of the initialiser have their DECL_CONTEXT()
 properly set.

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

15 years ago2008-07-30 Doug Rupp <rupp@adacore.com>
charlet [Wed, 30 Jul 2008 13:06:45 +0000 (13:06 +0000)]
2008-07-30  Doug Rupp  <rupp@adacore.com>

* gigi.h (build_vms_descriptor64): New function prototype.
(fill_vms_descriptor): Modified function prototype.

* utils.c (build_vms_descriptor64): New function.

* utils2.c (fill_vms_descriptor): Fix handling on 32bit systems.

* trans.c (call_to_gnu): Call fill_vms_descriptor with new third
argument.

* decl.c (gnat_to_gnu_tree): For By_Descriptor mech, build both a
64bit and 32bit descriptor and save the 64bit version as an alternate
TREE_TYPE in the parameter.
(make_type_from_size) <RECORD_TYPE>: Use the appropriate mode for the
thin pointer.

* ada-tree.h (DECL_PARM_ALT, SET_DECL_PARM_ALT): New macros.

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

15 years agoResync
charlet [Wed, 30 Jul 2008 13:04:41 +0000 (13:04 +0000)]
Resync

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

15 years ago2008-07-30 Jose Ruiz <ruiz@adacore.com>
charlet [Wed, 30 Jul 2008 13:03:32 +0000 (13:03 +0000)]
2008-07-30  Jose Ruiz  <ruiz@adacore.com>

* adaint.c
(__gnat_file_exists): Do not use __gnat_stat for RTX.
(__main for RTX in RTSS mode): Create this dummy procedure symbol to
avoid the use of this symbol from libgcc.a in RTX kernel mode.

* cio.c
(put_int, put_int_stderr, put_char, put_char_stderr): For RTX we call
the function RtPrintf for console output.

* argv.c Do not use the environ variable for RTX.

* gnatlink.adb (gnatlink): The part that handles the --RTS option has
been moved before the call to Osint.Add_Default_Search_Dirs in order
to take into account the flags in system.ads (RTX_RTSS_Kernel_Module)
from the appropriate run time.

* targparm.ads
(RTX_RTSS_Kernel_Module_On_Target): Add this flag that is set to True if
target is a RTSS module for RTX.

* targparm.adb (Targparm_Tags, RTX_Str, Targparm_Str): Add tag RTX for
RTX_RTSS_Kernel_Module
(Get_Target_Parameters): Add processing of RTX_RTSS_Kernel_Module flag.

* gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for RTX): Use gcc
exception handling mechanism for Windows and RTX in Win32 mode, but
not for RTX in kernel mode (RTSS).
(LIBGNAT_SRCS): Remove ada.h

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

15 years ago2008-07-30 Robert Dewar <dewar@adacore.com>
charlet [Wed, 30 Jul 2008 13:02:39 +0000 (13:02 +0000)]
2008-07-30  Robert Dewar  <dewar@adacore.com>

* osint.ads: Minor reformatting

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

15 years ago2008-07-30 Robert Dewar <dewar@adacore.com>
charlet [Wed, 30 Jul 2008 13:02:30 +0000 (13:02 +0000)]
2008-07-30  Robert Dewar  <dewar@adacore.com>

* mlib-utl.adb: Minor reformatting

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

15 years ago2008-07-30 Robert Dewar <dewar@adacore.com>
charlet [Wed, 30 Jul 2008 13:02:21 +0000 (13:02 +0000)]
2008-07-30  Robert Dewar  <dewar@adacore.com>

* make.adb: Minor reformatting

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

15 years ago2008-07-30 Paolo Bonzini <bonzini@gnu.org>
bonzini [Wed, 30 Jul 2008 12:17:17 +0000 (12:17 +0000)]
2008-07-30  Paolo Bonzini  <bonzini@gnu.org>

* configure.ac: Add makefile fragments for hpux.
* Makefile.def (flags_to_pass): Add ADA_CFLAGS.
* Makefile.tpl (HOST_EXPORTS): Pass ADA_CFLAGS.
* configure: Regenerate.
* Makefile.in: Regenerate.

config:
2008-07-30  Paolo Bonzini  <bonzini@gnu.org>

* mh-pa: New, from gcc/config/pa/x-ada.
* mh-pa-hpux10: New, from gcc/config/pa/x-ada-hpux10.

gcc:
2008-07-30  Paolo Bonzini  <bonzini@gnu.org>

* configure.ac: Substitute ADA_CFLAGS.
* configure: Regenerate.
* config.host: Remove mention of pa/x-ada and pa/x-ada-hpux10 files.
* Makefile.in: Remove mention of X_* variables.
* config/pa/x-ada-hpux10: Remove.
* config/pa/x-ada: Remove.

* doc/fragments.texi: Update.

gcc/ada:
2008-07-30  Paolo Bonzini  <bonzini@gnu.org>

* gcc-interface/Make-lang.in (ALL_ADAFLAGS): Remove X_ADAFLAGS and
T_ADAFLAGS, replace ALL_ADA_CFLAGS with ADA_CFLAGS.
(ALL_ADA_CFLAGS): Remove, replace throughout with ADA_CFLAGS.
* gcc-interface/Makefile.in (XCFLAGS, X_CFLAGS, X_CPPFLAGS, T_CPPFLAGS,
X_ADA_CFLAGS, T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS, ADA_CFLAGS,
ALL_ADA_CFLAGS): Remove.
(ALL_ADAFLAGS, MOST_ADAFLAGS): Remove X_ADAFLAGS and T_ADAFLAGS,
        replace ALL_ADA_CFLAGS with ADA_CFLAGS.
(GCC_CFLAGS): Remove X_CFLAGS.
(LOOSE_CFLAGS): Remove X_CFLAGS and XCFLAGS.
(ALL_CPPFLAGS): Remove X_CPPFLAGS and T_CPPFLAGS.
(ADA_CFLAGS): Substitute.

gnattools:
2008-07-30  Paolo Bonzini  <bonzini@gnu.org>

* configure.ac (x_ada_cflags): Remove.
(ADA_CFLAGS): Substitute.
* configure: Regenerate.
* Makefile.in (ADA_CFLAGS): Substitute.
(T_ADA_CFLAGS, X_ADA_CFLAGS, ALL_ADA_CFLAGS): Remove.
(TOOLS_FLAGS_TO_PASS_1, TOOLS_FLAGS_TO_PASS_1re,
TOOLS_FLAGS_TO_PASS_NATIVE, TOOLS_FLAGS_TO_PASS_CROSS):
Pass ADA_CFLAGS.

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

15 years agomove wrong gcc/ChangeLog entry to gnattools/ChangeLog
bonzini [Wed, 30 Jul 2008 12:09:47 +0000 (12:09 +0000)]
move wrong gcc/ChangeLog entry to gnattools/ChangeLog

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

15 years agoFix date on entry headline.
hainque [Wed, 30 Jul 2008 10:15:19 +0000 (10:15 +0000)]
Fix date on entry headline.

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

15 years ago * config/mips/irix-crti.asm: .hide __gcc_init and __gcc_fini.
hainque [Wed, 30 Jul 2008 10:13:46 +0000 (10:13 +0000)]
    * config/mips/irix-crti.asm: .hide __gcc_init and __gcc_fini.
        * config/mips/iris6.h (IRIX_SUBTARGET_LINK_SPEC, irix ld): Hide
        __dso_handle explicitly here.

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

15 years ago2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
manu [Wed, 30 Jul 2008 08:30:32 +0000 (08:30 +0000)]
2008-07-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR 34389
* c-typeck.c (build_binary_op): Encapsulate code into...
* c-common.c (shorten_binary_op): ...this new function.
(conversion_warning): Use the new function. Handle non-negative
constant in bitwise-and.
* c-common.h (shorten_binary_op): Declare.
cp/
* typeck.c (build_binary_op): Encapsulate code into
shorten_binary_op.
testsuite/
* gcc.dg/Wconversion-pr34389.c: New.
* g++.dg/warn/Wconversion-pr34389.C: New.

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

15 years ago * scan.c (make_sstring_space): Add explicit conversions of
hainque [Wed, 30 Jul 2008 07:44:09 +0000 (07:44 +0000)]
* scan.c (make_sstring_space): Add explicit conversions of
allocator's return value.
* fix-header.c (recognized_function): Likewise.

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

15 years agogcc/ChangeLog
guerby [Wed, 30 Jul 2008 06:45:39 +0000 (06:45 +0000)]
gcc/ChangeLog
2008-07-29  Laurent Guerby <laurent@guerby.net>

        PR ada/5911
        * gnattools/Makefile.in: Replace stamp-gnatlib by
        stamp-gnatlib-rts.

gcc/ada/ChangeLog
2008-07-29  Laurent Guerby <laurent@guerby.net>

        PR ada/5911
        * gcc-interface/Makefile.in (MULTISUBDIR, RTSDIR): New variables.
        Pass MULTISUBDIR to recursive make. Use $(RTSDIR) instead of rts.
        Replace stamp-gnatlib* by stamp-gnatlib*-rts.
        * gcc-interface/Make-lang.in: Replace stamp-gnatlib2
        by stamp-gnatlib2-rts.

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

15 years agogcc/ada/
rwild [Wed, 30 Jul 2008 05:28:53 +0000 (05:28 +0000)]
gcc/ada/
PR documentation/15479
* gnat-style.texi: Remove AdaCore copyright statement and GPL
statement for GNAT.  Add @copying stanza, use it.  Update to
GFDL 1.2.  Do not list GFDL as Invariant Section, do not list
title as Front-Cover Text.
* gnat_rm.texi: Likewise.
* gnat_ugn.texi: Likewise.

gcc/
* doc/cpp.texi: Update to GFDL 1.2.
* doc/gcc.texi: Do not list GPL as Invariant Section.
* doc/gccint.texi: Likewise.  Update copyright years.
* doc/install.texi: Update copyright years.

gcc/fortran/
* gfc-internals.texi: Update to GFDL 1.2.  Do not list GPL as
Invariant Section.
* gfortran.texi: Likewise.
* intrinsic.texi: Do not list GPL as Invariant Section.
* invoke.texi: Likewise.  Update copyright years.

gcc/java/
* gcj.texi: Update copyright years.  Do not list GPL as
Invariant Section.

libgomp/
* libgomp.texi: Update to GFDL 1.2.  Update copyright years.
Do not list GPL as Invariant Section.

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

15 years ago PR target/36955
amodra [Wed, 30 Jul 2008 02:43:05 +0000 (02:43 +0000)]
PR target/36955
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add
a use of pic_offset_table_rtx for -msecure-plt __tls_get_addr calls.

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

15 years agoDaily bump.
gccadmin [Wed, 30 Jul 2008 00:16:57 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago * gcc.dg/pr32370.c: Force 64 bits on IA64.
sje [Tue, 29 Jul 2008 22:32:32 +0000 (22:32 +0000)]
* gcc.dg/pr32370.c: Force 64 bits on IA64.

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

15 years agoIndex: gcc/fortran/trans-expr.c
pault [Tue, 29 Jul 2008 20:44:09 +0000 (20:44 +0000)]
Index: gcc/fortran/trans-expr.c
===================================================================
*** gcc/fortran/trans-expr.c (revision 138273)
--- gcc/fortran/trans-expr.c (working copy)
***************
*** 1,6 ****
  /* Expression translation
!    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
!    Foundation, Inc.
     Contributed by Paul Brook <paul@nowt.org>
     and Steven Bosscher <s.bosscher@student.tudelft.nl>

--- 1,6 ----
  /* Expression translation
!    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
!    Free Software Foundation, Inc.
     Contributed by Paul Brook <paul@nowt.org>
     and Steven Bosscher <s.bosscher@student.tudelft.nl>

*************** gfc_conv_component_ref (gfc_se * se, gfc
*** 395,400 ****
--- 395,434 ----
  }

+ /* This function deals with component references to components of the
+    parent type for derived type extensons.  */
+ static void
+ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
+ {
+   gfc_component *c;
+   gfc_component *cmp;
+   gfc_symbol *dt;
+   gfc_ref parent;
+
+   dt = ref->u.c.sym;
+   c = ref->u.c.component;
+
+   /* Build a gfc_ref to recursively call gfc_conv_component_ref.  */
+   parent.type = REF_COMPONENT;
+   parent.next = NULL;
+   parent.u.c.sym = dt;
+   parent.u.c.component = dt->components;
+
+   if (dt->attr.extension && dt->components)
+     {
+       /* Return if the component is not in the parent type.  */
+       for (cmp = dt->components->next; cmp; cmp = cmp->next)
+  if (strcmp (c->name, cmp->name) == 0)
+    return;
+
+       /* Otherwise build the reference and call self.  */
+       gfc_conv_component_ref (se, &parent);
+       parent.u.c.sym = dt->components->ts.derived;
+       parent.u.c.component = c;
+       conv_parent_component_references (se, &parent);
+     }
+ }
+
  /* Return the contents of a variable. Also handles reference/pointer
     variables (all Fortran pointer references are implicit).  */

*************** gfc_conv_variable (gfc_se * se, gfc_expr
*** 561,566 ****
--- 595,603 ----
     break;

   case REF_COMPONENT:
+    if (ref->u.c.sym->attr.extension)
+      conv_parent_component_references (se, ref);
+
     gfc_conv_component_ref (se, ref);
     break;

Index: gcc/fortran/trans-array.c
===================================================================
*** gcc/fortran/trans-array.c (revision 138273)
--- gcc/fortran/trans-array.c (working copy)
*************** gfc_conv_resolve_dependencies (gfc_loopi
*** 3257,3270 ****
        if (ss->type != GFC_SS_SECTION)
   continue;

!       if (gfc_could_be_alias (dest, ss)
!      || gfc_are_equivalenced_arrays (dest->expr, ss->expr))
   {
!    nDepend = 1;
!    break;
   }
!
!       if (dest->expr->symtree->n.sym == ss->expr->symtree->n.sym)
   {
     lref = dest->expr->ref;
     rref = ss->expr->ref;
--- 3257,3272 ----
        if (ss->type != GFC_SS_SECTION)
   continue;

!       if (dest->expr->symtree->n.sym != ss->expr->symtree->n.sym)
   {
!    if (gfc_could_be_alias (dest, ss)
!  || gfc_are_equivalenced_arrays (dest->expr, ss->expr))
!      {
!        nDepend = 1;
!        break;
!      }
   }
!       else
   {
     lref = dest->expr->ref;
     rref = ss->expr->ref;
Index: gcc/fortran/symbol.c
===================================================================
*** gcc/fortran/symbol.c (revision 138273)
--- gcc/fortran/symbol.c (working copy)
*************** gfc_add_component (gfc_symbol *sym, cons
*** 1701,1706 ****
--- 1701,1714 ----
        tail = p;
      }

+   if (sym->attr.extension
+  && gfc_find_component (sym->components->ts.derived, name))
+     {
+       gfc_error ("Component '%s' at %C already in the parent type "
+   "at %L", name, &sym->components->ts.derived->declared_at);
+       return FAILURE;
+     }
+
    /* Allocate a new component.  */
    p = gfc_get_component ();

*************** gfc_find_component (gfc_symbol *sym, con
*** 1830,1846 ****
      if (strcmp (p->name, name) == 0)
        break;

    if (p == NULL)
      gfc_error ("'%s' at %C is not a member of the '%s' structure",
          name, sym->name);
!   else
      {
!       if (sym->attr.use_assoc && (sym->component_access == ACCESS_PRIVATE
!    || p->access == ACCESS_PRIVATE))
   {
     gfc_error ("Component '%s' at %C is a PRIVATE component of '%s'",
        name, sym->name);
!    p = NULL;
   }
      }

--- 1838,1873 ----
      if (strcmp (p->name, name) == 0)
        break;

+   if (p == NULL
+  && sym->attr.extension
+  && sym->components->ts.type == BT_DERIVED)
+     {
+       p = gfc_find_component (sym->components->ts.derived, name);
+       /* Do not overwrite the error.  */
+       if (p == NULL)
+  return p;
+     }
+
    if (p == NULL)
      gfc_error ("'%s' at %C is not a member of the '%s' structure",
          name, sym->name);
!
!   else if (sym->attr.use_assoc)
      {
!       if (p->access == ACCESS_PRIVATE)
   {
     gfc_error ("Component '%s' at %C is a PRIVATE component of '%s'",
        name, sym->name);
!    return NULL;
!  }
!
!       /* If there were components given and all components are private, error
!   out at this place.  */
!       if (p->access != ACCESS_PUBLIC && sym->component_access == ACCESS_PRIVATE)
!  {
!    gfc_error ("All components of '%s' are PRIVATE in structure"
!       " constructor at %C", sym->name);
!    return NULL;
   }
      }

Index: gcc/fortran/decl.c
===================================================================
*** gcc/fortran/decl.c (revision 138273)
--- gcc/fortran/decl.c (working copy)
*************** match_data_constant (gfc_expr **result)
*** 367,373 ****
        return MATCH_ERROR;
      }
    else if (sym->attr.flavor == FL_DERIVED)
!     return gfc_match_structure_constructor (sym, result);

    /* Check to see if the value is an initialization array expression.  */
    if (sym->value->expr_type == EXPR_ARRAY)
--- 367,373 ----
        return MATCH_ERROR;
      }
    else if (sym->attr.flavor == FL_DERIVED)
!     return gfc_match_structure_constructor (sym, result, false);

    /* Check to see if the value is an initialization array expression.  */
    if (sym->value->expr_type == EXPR_ARRAY)
*************** syntax:
*** 6250,6255 ****
--- 6250,6298 ----
  }

+ /* Check a derived type that is being extended.  */
+ static gfc_symbol*
+ check_extended_derived_type (char *name)
+ {
+   gfc_symbol *extended;
+
+   if (gfc_find_symbol (name, gfc_current_ns, 1, &extended))
+     {
+       gfc_error ("Ambiguous symbol in TYPE definition at %C");
+       return NULL;
+     }
+
+   if (!extended)
+     {
+       gfc_error ("No such symbol in TYPE definition at %C");
+       return NULL;
+     }
+
+   if (extended->attr.flavor != FL_DERIVED)
+     {
+       gfc_error ("'%s' in EXTENDS expression at %C is not a "
+   "derived type", name);
+       return NULL;
+     }
+
+   if (extended->attr.is_bind_c)
+     {
+       gfc_error ("'%s' cannot be extended at %C because it "
+   "is BIND(C)", extended->name);
+       return NULL;
+     }
+
+   if (extended->attr.sequence)
+     {
+       gfc_error ("'%s' cannot be extended at %C because it "
+   "is a SEQUENCE type", extended->name);
+       return NULL;
+     }
+
+   return extended;
+ }
+
+
  /* Match the optional attribute specifiers for a type declaration.
     Return MATCH_ERROR if an error is encountered in one of the handled
     attributes (public, private, bind(c)), MATCH_NO if what's found is
*************** syntax:
*** 6257,6263 ****
     checking on attribute conflicts needs to be done.  */

  match
! gfc_get_type_attr_spec (symbol_attribute *attr)
  {
    /* See if the derived type is marked as private.  */
    if (gfc_match (" , private") == MATCH_YES)
--- 6300,6306 ----
     checking on attribute conflicts needs to be done.  */

  match
! gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
  {
    /* See if the derived type is marked as private.  */
    if (gfc_match (" , private") == MATCH_YES)
*************** gfc_get_type_attr_spec (symbol_attribute
*** 6295,6300 ****
--- 6338,6349 ----

        /* TODO: attr conflicts need to be checked, probably in symbol.c.  */
      }
+   else if (name && gfc_match(" , extends ( %n )", name) == MATCH_YES)
+     {
+       if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: derived type "
+      "extended at %C") == FAILURE)
+  return MATCH_ERROR;
+     }
    else
      return MATCH_NO;

*************** match
*** 6311,6318 ****
--- 6360,6369 ----
  gfc_match_derived_decl (void)
  {
    char name[GFC_MAX_SYMBOL_LEN + 1];
+   char parent[GFC_MAX_SYMBOL_LEN + 1];
    symbol_attribute attr;
    gfc_symbol *sym;
+   gfc_symbol *extended;
    match m;
    match is_type_attr_spec = MATCH_NO;
    bool seen_attr = false;
*************** gfc_match_derived_decl (void)
*** 6320,6336 ****
    if (gfc_current_state () == COMP_DERIVED)
      return MATCH_NO;

    gfc_clear_attr (&attr);

    do
      {
!       is_type_attr_spec = gfc_get_type_attr_spec (&attr);
        if (is_type_attr_spec == MATCH_ERROR)
   return MATCH_ERROR;
        if (is_type_attr_spec == MATCH_YES)
   seen_attr = true;
      } while (is_type_attr_spec == MATCH_YES);

    if (gfc_match (" ::") != MATCH_YES && seen_attr)
      {
        gfc_error ("Expected :: in TYPE definition at %C");
--- 6371,6397 ----
    if (gfc_current_state () == COMP_DERIVED)
      return MATCH_NO;

+   name[0] = '\0';
+   parent[0] = '\0';
    gfc_clear_attr (&attr);
+   extended = NULL;

    do
      {
!       is_type_attr_spec = gfc_get_type_attr_spec (&attr, parent);
        if (is_type_attr_spec == MATCH_ERROR)
   return MATCH_ERROR;
        if (is_type_attr_spec == MATCH_YES)
   seen_attr = true;
      } while (is_type_attr_spec == MATCH_YES);

+   /* Deal with derived type extensions.  */
+   if (parent[0])
+     extended = check_extended_derived_type (parent);
+
+   if (parent[0] && !extended)
+     return MATCH_ERROR;
+
    if (gfc_match (" ::") != MATCH_YES && seen_attr)
      {
        gfc_error ("Expected :: in TYPE definition at %C");
*************** gfc_match_derived_decl (void)
*** 6383,6392 ****
--- 6444,6477 ----
    if (attr.is_bind_c != 0)
      sym->attr.is_bind_c = attr.is_bind_c;

+
    /* Construct the f2k_derived namespace if it is not yet there.  */
    if (!sym->f2k_derived)
      sym->f2k_derived = gfc_get_namespace (NULL, 0);

+
+   if (extended && !sym->components)
+     {
+       gfc_component *p;
+       gfc_symtree *st;
+
+       /* Add the extended derived type as the first component.  */
+       gfc_add_component (sym, parent, &p);
+       sym->attr.extension = 1;
+       extended->refs++;
+       gfc_set_sym_referenced (extended);
+
+       p->ts.type = BT_DERIVED;
+       p->ts.derived = extended;
+       p->initializer = gfc_default_initializer (&p->ts);
+
+       /* Provide the links between the extended type and its extension.  */
+       if (!extended->f2k_derived)
+  extended->f2k_derived = gfc_get_namespace (NULL, 0);
+       st = gfc_new_symtree (&extended->f2k_derived->sym_root, sym->name);
+       st->n.sym = sym;
+     }
+
    gfc_new_block = sym;

    return MATCH_YES;
Index: gcc/fortran/gfortran.h
===================================================================
*** gcc/fortran/gfortran.h (revision 138273)
--- gcc/fortran/gfortran.h (working copy)
*************** typedef struct
*** 638,643 ****
--- 638,644 ----
    unsigned untyped:1;           /* No implicit type could be found.  */

    unsigned is_bind_c:1; /* say if is bound to C */
+   unsigned extension:1; /* extends a derived type */

    /* These flags are both in the typespec and attribute.  The attribute
       list is what gets read from/written to a module file.  The typespec
*************** typedef struct gfc_symbol
*** 1016,1024 ****

    gfc_formal_arglist *formal;
    struct gfc_namespace *formal_ns;
-
-   /* The namespace containing type-associated procedure symbols.  */
-   /* TODO: Make this union with formal?  */
    struct gfc_namespace *f2k_derived;

    struct gfc_expr *value; /* Parameter/Initializer value */
--- 1017,1022 ----
Index: gcc/fortran/ChangeLog
===================================================================
*** gcc/fortran/ChangeLog (revision 138273)
--- gcc/fortran/ChangeLog (working copy)
***************
*** 1,3 ****
--- 1,42 ----
+ 2008-07-29  Paul Thomas  <pault@gcc.gnu.org>
+
+  * trans-expr.c (conv_parent_component_references): New function
+  to build missing parent references.
+  (gfc_conv_variable): Call it
+  * symbol.c (gfc_add_component): Check that component name in a
+  derived type extension does not appear in parent.
+  (gfc_find_component): For a derived type extension, check if
+  the component appears in the parent derived type by calling
+  self. Separate errors for private components and private types.
+  * decl.c (match_data_constant): Add extra arg to call to
+  gfc_match_structure_constructor.
+  (check_extended_derived_type): New function to check that a
+  parent derived type exists and that it is OK for exension.
+  (gfc_get_type_attr_spec): Add extra argument 'name' and return
+  it if extends is specified.
+  (gfc_match_derived_decl): Match derived type extension and
+  build a first component of the parent derived type if OK. Add
+  the f2k namespace if not present.
+  * gfortran.h : Add the extension attribute.
+  * module.c : Handle attribute 'extension'.
+  * match.h : Modify prototypes for gfc_get_type_attr_spec and
+  gfc_match_structure_constructor.
+  * primary.c (build_actual_constructor): New function extracted
+  from gfc_match_structure_constructor and modified to call self
+  iteratively to build derived type extensions, when f2k named
+  components are used.
+  (gfc_match_structure_constructor): Do not throw error for too
+  many components if a parent type is being handled. Use
+  gfc_find_component to generate errors for non-existent or
+  private components.  Iteratively call self for derived type
+  extensions so that parent constructor is built.  If extension
+  and components left over, throw error.
+  (gfc_match_rvalue): Add extra arg to call to
+  gfc_match_structure_constructor.
+
+  * trans-array.c (gfc_conv_resolve_dependencies): If lhs and rhs
+  are the same symbol, aliassing does not matter.
+
  2008-07-29  Jan Hubicka  <jh@suse.cz>

   * options.c (gfc_post_options): Do not set flag_no_inline.
Index: gcc/fortran/module.c
===================================================================
*** gcc/fortran/module.c (revision 138273)
--- gcc/fortran/module.c (working copy)
*************** typedef enum
*** 1648,1654 ****
    AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT,
    AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP,
    AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
!   AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP
  }
  ab_attribute;

--- 1648,1655 ----
    AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT,
    AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP,
    AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
!   AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP,
!   AB_EXTENSION
  }
  ab_attribute;

*************** static const mstring attr_bits[] =
*** 1688,1693 ****
--- 1689,1695 ----
      minit ("ZERO_COMP", AB_ZERO_COMP),
      minit ("PROTECTED", AB_PROTECTED),
      minit ("ABSTRACT", AB_ABSTRACT),
+     minit ("EXTENSION", AB_EXTENSION),
      minit (NULL, -1)
  };

*************** mio_symbol_attribute (symbol_attribute *
*** 1801,1806 ****
--- 1803,1810 ----
   MIO_NAME (ab_attribute) (AB_PRIVATE_COMP, attr_bits);
        if (attr->zero_comp)
   MIO_NAME (ab_attribute) (AB_ZERO_COMP, attr_bits);
+       if (attr->extension)
+  MIO_NAME (ab_attribute) (AB_EXTENSION, attr_bits);

        mio_rparen ();

*************** mio_symbol_attribute (symbol_attribute *
*** 1919,1924 ****
--- 1923,1931 ----
       case AB_ZERO_COMP:
         attr->zero_comp = 1;
         break;
+      case AB_EXTENSION:
+        attr->extension = 1;
+        break;
       }
   }
      }
Index: gcc/fortran/trans-io.c
===================================================================
*** gcc/fortran/trans-io.c (revision 138273)
--- gcc/fortran/trans-io.c (working copy)
***************
*** 1,6 ****
  /* IO Code translation/library interface
!    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
!    Foundation, Inc.
     Contributed by Paul Brook

  This file is part of GCC.
--- 1,6 ----
  /* IO Code translation/library interface
!    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
!    Free Software Foundation, Inc.
     Contributed by Paul Brook

  This file is part of GCC.
Index: gcc/fortran/match.h
===================================================================
*** gcc/fortran/match.h (revision 138273)
--- gcc/fortran/match.h (working copy)
*************** gfc_try get_bind_c_idents (void);
*** 182,191 ****
  match gfc_match_bind_c_stmt (void);
  match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
  match gfc_match_bind_c (gfc_symbol *, bool);
! match gfc_get_type_attr_spec (symbol_attribute *);

  /* primary.c.  */
! match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **);
  match gfc_match_variable (gfc_expr **, int);
  match gfc_match_equiv_variable (gfc_expr **);
  match gfc_match_actual_arglist (int, gfc_actual_arglist **);
--- 182,191 ----
  match gfc_match_bind_c_stmt (void);
  match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
  match gfc_match_bind_c (gfc_symbol *, bool);
! match gfc_get_type_attr_spec (symbol_attribute *, char*);

  /* primary.c.  */
! match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **, bool);
  match gfc_match_variable (gfc_expr **, int);
  match gfc_match_equiv_variable (gfc_expr **);
  match gfc_match_actual_arglist (int, gfc_actual_arglist **);
Index: gcc/fortran/primary.c
===================================================================
*** gcc/fortran/primary.c (revision 138273)
--- gcc/fortran/primary.c (working copy)
*************** gfc_free_structure_ctor_component (gfc_s
*** 1984,1994 ****
    gfc_free_expr (comp->val);
  }

! match
! gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
  {
-   gfc_structure_ctor_component *comp_head, *comp_tail;
    gfc_structure_ctor_component *comp_iter;
    gfc_constructor *ctor_head, *ctor_tail;
    gfc_component *comp; /* Is set NULL when named component is first seen */
    gfc_expr *e;
--- 1984,2086 ----
    gfc_free_expr (comp->val);
  }

!
! /* Translate the component list into the actual constructor by sorting it in
!    the order required; this also checks along the way that each and every
!    component actually has an initializer and handles default initializers
!    for components without explicit value given.  */
! static gfc_try
! build_actual_constructor (gfc_structure_ctor_component **comp_head,
!    gfc_constructor **ctor_head, gfc_symbol *sym)
  {
    gfc_structure_ctor_component *comp_iter;
+   gfc_constructor *ctor_tail = NULL;
+   gfc_component *comp;
+
+   for (comp = sym->components; comp; comp = comp->next)
+     {
+       gfc_structure_ctor_component **next_ptr;
+       gfc_expr *value = NULL;
+
+       /* Try to find the initializer for the current component by name.  */
+       next_ptr = comp_head;
+       for (comp_iter = *comp_head; comp_iter; comp_iter = comp_iter->next)
+  {
+    if (!strcmp (comp_iter->name, comp->name))
+      break;
+    next_ptr = &comp_iter->next;
+  }
+
+       /* If an extension, try building the parent derived type by building
+   a value expression for the parent derived type and calling self.  */
+       if (!comp_iter && comp == sym->components && sym->attr.extension)
+  {
+    value = gfc_get_expr ();
+    value->expr_type = EXPR_STRUCTURE;
+    value->value.constructor = NULL;
+    value->ts = comp->ts;
+    value->where = gfc_current_locus;
+
+    if (build_actual_constructor (comp_head, &value->value.constructor,
+  comp->ts.derived) == FAILURE)
+      {
+        gfc_free_expr (value);
+        return FAILURE;
+      }
+    *ctor_head = ctor_tail = gfc_get_constructor ();
+    ctor_tail->expr = value;
+    continue;
+  }
+
+       /* If it was not found, try the default initializer if there's any;
+   otherwise, it's an error.  */
+       if (!comp_iter)
+  {
+    if (comp->initializer)
+      {
+        if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure"
+    " constructor with missing optional arguments"
+    " at %C") == FAILURE)
+  return FAILURE;
+        value = gfc_copy_expr (comp->initializer);
+      }
+    else
+      {
+        gfc_error ("No initializer for component '%s' given in the"
+   " structure constructor at %C!", comp->name);
+        return FAILURE;
+      }
+  }
+       else
+  value = comp_iter->val;
+
+       /* Add the value to the constructor chain built.  */
+       if (ctor_tail)
+  {
+    ctor_tail->next = gfc_get_constructor ();
+    ctor_tail = ctor_tail->next;
+  }
+       else
+  *ctor_head = ctor_tail = gfc_get_constructor ();
+       gcc_assert (value);
+       ctor_tail->expr = value;
+
+       /* Remove the entry from the component list.  We don't want the expression
+   value to be free'd, so set it to NULL.  */
+       if (comp_iter)
+  {
+    *next_ptr = comp_iter->next;
+    comp_iter->val = NULL;
+    gfc_free_structure_ctor_component (comp_iter);
+  }
+     }
+   return SUCCESS;
+ }
+
+ match
+ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, bool parent)
+ {
+   gfc_structure_ctor_component *comp_tail, *comp_head, *comp_iter;
    gfc_constructor *ctor_head, *ctor_tail;
    gfc_component *comp; /* Is set NULL when named component is first seen */
    gfc_expr *e;
*************** gfc_match_structure_constructor (gfc_sym
*** 1996,2005 ****
    match m;
    const char* last_name = NULL;

!   comp_head = comp_tail = NULL;
    ctor_head = ctor_tail = NULL;

!   if (gfc_match_char ('(') != MATCH_YES)
      goto syntax;

    where = gfc_current_locus;
--- 2088,2097 ----
    match m;
    const char* last_name = NULL;

!   comp_tail = comp_head = NULL;
    ctor_head = ctor_tail = NULL;

!   if (!parent && gfc_match_char ('(') != MATCH_YES)
      goto syntax;

    where = gfc_current_locus;
*************** gfc_match_structure_constructor (gfc_sym
*** 2047,2053 ****
     if (last_name)
       gfc_error ("Component initializer without name after"
          " component named %s at %C!", last_name);
!    else
       gfc_error ("Too many components in structure constructor at"
          " %C!");
     goto cleanup;
--- 2139,2145 ----
     if (last_name)
       gfc_error ("Component initializer without name after"
          " component named %s at %C!", last_name);
!    else if (!parent)
       gfc_error ("Too many components in structure constructor at"
          " %C!");
     goto cleanup;
*************** gfc_match_structure_constructor (gfc_sym
*** 2057,2095 ****
         strncpy (comp_tail->name, comp->name, GFC_MAX_SYMBOL_LEN + 1);
       }

!    /* Find the current component in the structure definition; this is
!       needed to get its access attribute in the private check below.  */
     if (comp)
!      this_comp = comp;
     else
       {
!        for (comp = sym->components; comp; comp = comp->next)
!  if (!strcmp (comp->name, comp_tail->name))
!    {
!      this_comp = comp;
!      break;
!    }
         comp = NULL; /* Reset needed!  */
-
-        /* Here we can check if a component name is given which does not
-   correspond to any component of the defined structure.  */
-        if (!this_comp)
-  {
-    gfc_error ("Component '%s' in structure constructor at %C"
-       " does not correspond to any component in the"
-       " constructed structure!", comp_tail->name);
-    goto cleanup;
-  }
       }
-    gcc_assert (this_comp);

!    /* Check the current component's access status.  */
!    if (sym->attr.use_assoc && this_comp->access == ACCESS_PRIVATE)
!      {
!        gfc_error ("Component '%s' is PRIVATE in structure constructor"
!   " at %C!", comp_tail->name);
!        goto cleanup;
!      }

     /* Check if this component is already given a value.  */
     for (comp_iter = comp_head; comp_iter != comp_tail;
--- 2149,2168 ----
         strncpy (comp_tail->name, comp->name, GFC_MAX_SYMBOL_LEN + 1);
       }

!    /* Find the current component in the structure definition and check its
!       access is not private.  */
     if (comp)
!      this_comp = gfc_find_component (sym, comp->name);
     else
       {
!        this_comp = gfc_find_component (sym, (const char *)comp_tail->name);
         comp = NULL; /* Reset needed!  */
       }

!    /* Here we can check if a component name is given which does not
!       correspond to any component of the defined structure.  */
!    if (!this_comp)
!      goto cleanup;

     /* Check if this component is already given a value.  */
     for (comp_iter = comp_head; comp_iter != comp_tail;
*************** gfc_match_structure_constructor (gfc_sym
*** 2111,2199 ****
     if (m == MATCH_ERROR)
       goto cleanup;

!    if (comp)
       comp = comp->next;
   }
        while (gfc_match_char (',') == MATCH_YES);

!       if (gfc_match_char (')') != MATCH_YES)
   goto syntax;
-
-       /* If there were components given and all components are private, error
-   out at this place.  */
-       if (sym->attr.use_assoc && sym->component_access == ACCESS_PRIVATE)
-  {
-    gfc_error ("All components of '%s' are PRIVATE in structure"
-       " constructor at %C", sym->name);
-    goto cleanup;
-  }
      }

!   /* Translate the component list into the actual constructor by sorting it in
!      the order required; this also checks along the way that each and every
!      component actually has an initializer and handles default initializers
!      for components without explicit value given.  */
!   for (comp = sym->components; comp; comp = comp->next)
!     {
!       gfc_structure_ctor_component **next_ptr;
!       gfc_expr *value = NULL;

!       /* Try to find the initializer for the current component by name.  */
!       next_ptr = &comp_head;
        for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next)
   {
!    if (!strcmp (comp_iter->name, comp->name))
!      break;
!    next_ptr = &comp_iter->next;
!  }
!
!       /* If it was not found, try the default initializer if there's any;
!   otherwise, it's an error.  */
!       if (!comp_iter)
!  {
!    if (comp->initializer)
!      {
!        if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure"
!    " constructor with missing optional arguments"
!    " at %C") == FAILURE)
!  goto cleanup;
!        value = gfc_copy_expr (comp->initializer);
!      }
!    else
!      {
!        gfc_error ("No initializer for component '%s' given in the"
!   " structure constructor at %C!", comp->name);
!        goto cleanup;
!      }
!  }
!       else
!  value = comp_iter->val;
!
!       /* Add the value to the constructor chain built.  */
!       if (ctor_tail)
!  {
!    ctor_tail->next = gfc_get_constructor ();
!    ctor_tail = ctor_tail->next;
!  }
!       else
!  ctor_head = ctor_tail = gfc_get_constructor ();
!       gcc_assert (value);
!       ctor_tail->expr = value;
!
!       /* Remove the entry from the component list.  We don't want the expression
!   value to be free'd, so set it to NULL.  */
!       if (comp_iter)
!  {
!    *next_ptr = comp_iter->next;
!    comp_iter->val = NULL;
!    gfc_free_structure_ctor_component (comp_iter);
   }
      }
!
!   /* No component should be left, as this should have caused an error in the
!      loop constructing the component-list (name that does not correspond to any
!      component in the structure definition).  */
!   gcc_assert (!comp_head);

    e = gfc_get_expr ();

--- 2184,2239 ----
     if (m == MATCH_ERROR)
       goto cleanup;

!    /* If not explicitly a parent constructor, gather up the components
!       and build one.  */
!    if (comp && comp == sym->components
!  && sym->attr.extension
!  && (comp_tail->val->ts.type != BT_DERIVED
!        ||
!      comp_tail->val->ts.derived != this_comp->ts.derived))
!      {
!        gfc_current_locus = where;
!        gfc_free_expr (comp_tail->val);
!
!        m = gfc_match_structure_constructor (comp->ts.derived,
!     &comp_tail->val, true);
!        if (m == MATCH_NO)
!  goto syntax;
!        if (m == MATCH_ERROR)
!  goto cleanup;
!      }
!
!     if (comp)
       comp = comp->next;
+
+    if (parent && !comp)
+      break;
   }
+
        while (gfc_match_char (',') == MATCH_YES);

!       if (!parent && gfc_match_char (')') != MATCH_YES)
   goto syntax;
      }

!   if (build_actual_constructor (&comp_head, &ctor_head, sym) == FAILURE)
!     goto cleanup;

!   /* No component should be left, as this should have caused an error in the
!      loop constructing the component-list (name that does not correspond to any
!      component in the structure definition).  */
!   if (comp_head && sym->attr.extension)
!     {
        for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next)
   {
!    gfc_error ("component '%s' at %L has already been set by a "
!       "parent derived type constructor", comp_iter->name,
!       &comp_iter->where);
   }
+       goto cleanup;
      }
!   else
!     gcc_assert (!comp_head);

    e = gfc_get_expr ();

*************** gfc_match_rvalue (gfc_expr **result)
*** 2396,2402 ****
        if (sym == NULL)
   m = MATCH_ERROR;
        else
!  m = gfc_match_structure_constructor (sym, &e);
        break;

      /* If we're here, then the name is known to be the name of a
--- 2436,2442 ----
        if (sym == NULL)
   m = MATCH_ERROR;
        else
!  m = gfc_match_structure_constructor (sym, &e, false);
        break;

      /* If we're here, then the name is known to be the name of a
Index: gcc/testsuite/ChangeLog
===================================================================
*** gcc/testsuite/ChangeLog (revision 138273)
--- gcc/testsuite/ChangeLog (working copy)
***************
*** 1,3 ****
--- 1,15 ----
+ 2008-07-29  Paul Thomas  <pault@gcc.gnu.org>
+
+  * gfortran.dg/extends_1.f03: New test.
+  * gfortran.dg/extends_2.f03: New test.
+  * gfortran.dg/extends_3.f03: New test.
+  * gfortran.dg/extends_4.f03: New test.
+  * gfortran.dg/extends_5.f03: New test.
+  * gfortran.dg/extends_6.f03: New test.
+  * gfortran.dg/private_type_6.f90: Modify error message.
+  * gfortran.dg/structure_constructor_7.f03: Modify error message.
+  * gfortran.dg/structure_constructor_8.f03: Modify error message.
+
  2008-07-29  Richard Guenther  <rguenther@suse.de>

   PR tree-optimization/36945
Index: gcc/testsuite/gfortran.dg/extends_1.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_1.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_1.f03 (revision 0)
***************
*** 0 ****
--- 1,73 ----
+ ! { dg-do run }
+ ! A basic functional test of derived type extension.
+ !
+ ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
+ !
+ module persons
+   type :: person
+     character(24) :: name = ""
+     integer :: ss = 1
+   end type person
+ end module persons
+
+ module person_education
+   use persons
+   type, extends(person) :: education
+     integer ::  attainment = 0
+     character(24) :: institution = ""
+   end type education
+ end module person_education
+
+   use person_education
+   type, extends(education) :: service
+     integer :: personnel_number = 0
+     character(24) :: department = ""
+   end type service
+
+   type, extends(service) :: person_record
+     type (person_record), pointer :: supervisor => NULL ()
+   end type person_record
+
+   type(person_record), pointer :: recruit, supervisor
+
+ ! Check that references by ultimate component work
+
+   allocate (supervisor)
+   supervisor%name = "Joe Honcho"
+   supervisor%ss = 123455
+   supervisor%attainment = 100
+   supervisor%institution = "Celestial University"
+   supervisor%personnel_number = 1
+   supervisor%department = "Directorate"
+
+   recruit => entry ("John Smith", 123456, 1, "Bog Hill High School", &
+                     99, "Records", supervisor)
+
+   if (trim (recruit%name) /= "John Smith") call abort
+   if (recruit%name /= recruit%service%name) call abort
+   if (recruit%supervisor%ss /= 123455) call abort
+   if (recruit%supervisor%ss /= supervisor%person%ss) call abort
+
+   deallocate (supervisor)
+   deallocate (recruit)
+ contains
+   function entry (name, ss, attainment, institution, &
+                   personnel_number, department, supervisor) result (new_person)
+     integer :: ss, attainment, personnel_number
+     character (*) :: name, institution, department
+     type (person_record), pointer :: supervisor, new_person
+
+     allocate (new_person)
+
+ ! Check mixtures of references
+     new_person%person%name = name
+     new_person%service%education%person%ss = ss
+     new_person%service%attainment = attainment
+     new_person%education%institution = institution
+     new_person%personnel_number = personnel_number
+     new_person%service%department = department
+     new_person%supervisor => supervisor
+   end function
+ end
+
+ ! { dg-final { cleanup-modules "persons person_education" } }
Index: gcc/testsuite/gfortran.dg/extends_2.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_2.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_2.f03 (revision 0)
***************
*** 0 ****
--- 1,66 ----
+ ! { dg-do run }
+ ! A test of f95 style constructors with derived type extension.
+ !
+ ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
+ !
+ module persons
+   type :: person
+     character(24) :: name = ""
+     integer :: ss = 1
+   end type person
+ end module persons
+
+ module person_education
+   use persons
+   type, extends(person) :: education
+     integer ::  attainment = 0
+     character(24) :: institution = ""
+   end type education
+ end module person_education
+
+   use person_education
+   type, extends(education) :: service
+     integer :: personnel_number = 0
+     character(24) :: department = ""
+   end type service
+
+   type, extends(service) :: person_record
+     type (person_record), pointer :: supervisor => NULL ()
+   end type person_record
+
+   type(person_record), pointer :: recruit, supervisor
+
+ ! Check that simple constructor works
+   allocate (supervisor)
+   supervisor%service = service ("Joe Honcho", 123455, 100, &
+                                 "Celestial University", 1, &
+                                 "Directorate")
+
+   recruit => entry ("John Smith", 123456, 1, "Bog Hill High School", &
+                     99, "Records", supervisor)
+
+   if (trim (recruit%name) /= "John Smith") call abort
+   if (recruit%name /= recruit%service%name) call abort
+   if (recruit%supervisor%ss /= 123455) call abort
+   if (recruit%supervisor%ss /= supervisor%person%ss) call abort
+
+   deallocate (supervisor)
+   deallocate (recruit)
+ contains
+   function entry (name, ss, attainment, institution, &
+                   personnel_number, department, supervisor) result (new_person)
+     integer :: ss, attainment, personnel_number
+     character (*) :: name, institution, department
+     type (person_record), pointer :: supervisor, new_person
+
+     allocate (new_person)
+
+ ! Check nested constructors
+     new_person = person_record (education (person (name, ss), &
+                                 attainment, institution), &
+                                 personnel_number, department, &
+                                 supervisor)
+   end function
+ end
+
+ ! { dg-final { cleanup-modules "persons person_education" } }
Index: gcc/testsuite/gfortran.dg/extends_3.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_3.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_3.f03 (revision 0)
***************
*** 0 ****
--- 1,71 ----
+ ! { dg-do run }
+ ! A test of f2k style constructors with derived type extension.
+ !
+ ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
+ !
+ module persons
+   type :: person
+     character(24) :: name = ""
+     integer :: ss = 1
+   end type person
+ end module persons
+
+ module person_education
+   use persons
+   type, extends(person) :: education
+     integer ::  attainment = 0
+     character(24) :: institution = ""
+   end type education
+ end module person_education
+
+   use person_education
+   type, extends(education) :: service
+     integer :: personnel_number = 0
+     character(24) :: department = ""
+   end type service
+
+   type, extends(service) :: person_record
+     type (person_record), pointer :: supervisor => NULL ()
+   end type person_record
+
+   type(person_record), pointer :: recruit, supervisor
+
+ ! Check that F2K constructor with missing entries works
+   allocate (supervisor)
+   supervisor%service = service (NAME = "Joe Honcho", SS= 123455)
+
+   recruit => entry ("John Smith", 123456, 1, "Bog Hill High School", &
+                     99, "Records", supervisor)
+
+   if (supervisor%ss /= 123455) call abort
+   if (trim (supervisor%name) /= "Joe Honcho") call abort
+   if (trim (supervisor%institution) /= "") call abort
+   if (supervisor%attainment /= 0) call abort
+
+   if (trim (recruit%name) /= "John Smith") call abort
+   if (recruit%name /= recruit%service%name) call abort
+   if (recruit%supervisor%ss /= 123455) call abort
+   if (recruit%supervisor%ss /= supervisor%person%ss) call abort
+
+   deallocate (supervisor)
+   deallocate (recruit)
+ contains
+   function entry (name, ss, attainment, institution, &
+                   personnel_number, department, supervisor) result (new_person)
+     integer :: ss, attainment, personnel_number
+     character (*) :: name, institution, department
+     type (person_record), pointer :: supervisor, new_person
+
+     allocate (new_person)
+
+ ! Check F2K constructor with order shuffled a bit
+     new_person = person_record (NAME = name, SS =ss, &
+                                 DEPARTMENT = department, &
+                                 INSTITUTION = institution, &
+                                 PERSONNEL_NUMBER = personnel_number, &
+                                 ATTAINMENT = attainment, &
+                                 SUPERVISOR = supervisor)
+   end function
+ end
+
+ ! { dg-final { cleanup-modules "persons person_education" } }
Index: gcc/testsuite/gfortran.dg/extends_4.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_4.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_4.f03 (revision 0)
***************
*** 0 ****
--- 1,52 ----
+ ! { dg-do run }
+ ! Check that derived type extension is compatible with renaming
+ ! the parent type and that allocatable components are OK.  At
+ ! the same time, private type and components are checked.
+ !
+ ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
+ !
+ module mymod
+   type :: a
+     real, allocatable :: x(:)
+     integer, private :: ia = 0
+   end type a
+   type :: b
+     private
+     real, allocatable :: x(:)
+     integer :: i
+   end type b
+ contains
+   function set_b () result (res)
+     type(b) :: res
+     allocate (res%x(2))
+     res%x = [10.0, 20.0]
+     res%i = 1
+   end function
+   subroutine check_b (arg)
+     type(b) :: arg
+     if (any (arg%x /= [10.0, 20.0])) call abort
+     if (arg%i /= 1) call abort
+   end subroutine
+ end module mymod
+
+   use mymod, e => a
+   type, extends(e) :: f
+     integer :: if
+   end type f
+   type, extends(b) :: d
+     integer :: id
+   end type d
+
+   type(f) :: p
+   type(d) :: q
+
+   p = f (x = [1.0, 2.0], if = 3)
+   if (any (p%e%x /= [1.0, 2.0])) call abort
+
+   q%b = set_b ()
+   call check_b (q%b)
+   q = d (b = set_b (), id = 99)
+   call check_b (q%b)
+ end
+
+ ! { dg-final { cleanup-modules "persons person_education" } }
Index: gcc/testsuite/gfortran.dg/extends_5.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_5.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_5.f03 (revision 0)
***************
*** 0 ****
--- 1,27 ----
+ ! { dg-do compile }
+ ! Some errors for derived type extension.
+ !
+ ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
+ !
+ module m
+   use iso_c_binding
+   type :: date
+     sequence
+     integer :: yr, mon
+     integer,public :: day
+   end type
+   type, bind(c) :: dt
+     integer(c_int) :: yr, mon
+     integer(c_int) :: day
+   end type
+ end module m
+
+   use m
+   type, extends(date) :: datetime ! { dg-error "because it is a SEQUENCE type" }
+   end type ! { dg-error "Expecting END PROGRAM" }
+
+   type, extends(dt) :: dt_type ! { dg-error "because it is BIND" }
+   end type ! { dg-error "Expecting END PROGRAM" }
+ end
+
+ ! { dg-final { cleanup-modules "m" } }
Index: gcc/testsuite/gfortran.dg/extends_6.f03
===================================================================
*** gcc/testsuite/gfortran.dg/extends_6.f03 (revision 0)
--- gcc/testsuite/gfortran.dg/extends_6.f03 (revision 0)
***************
*** 0 ****
--- 1,49 ----
+ ! { dg-do compile }
+ ! Some errors pointed out in the development of the patch.
+ !
+ ! Contributed by Tobias Burnus  <burnus@net-b.de>
+ !
+ module m
+   type :: date
+     private
+     integer :: yr, mon
+     integer,public :: day
+   end type
+   type :: dt
+     integer :: yr, mon
+     integer :: day
+   end type
+ end module m
+
+   use m
+   type, extends(date) :: datetime
+     integer :: hr, min, sec
+   end type
+   type(datetime) :: o_dt
+
+   type :: one
+     integer :: i
+   end type one
+
+   type, extends(one) :: two
+     real :: r
+   end type two
+
+   o_dt%day = 5  ! VALID but failed in first version of EXTENDS patch
+   o_dt%yr  = 5  ! { dg-error "All components of 'date' are PRIVATE" }
+
+   t = two(one = one(4), i = 5, r=4.4) ! { dg-error "has already been set" }
+
+   call foo
+ contains
+   subroutine foo
+     use m, date_type => dt
+     type, extends(date_type) :: dt_type
+     end type
+     type (dt_type) :: foo_dt
+     foo_dt%date_type%day = 1
+     foo_dt%dt%day = 1 ! { dg-error "not a member" }
+   end subroutine
+ end
+
+ ! { dg-final { cleanup-modules "m" } }
Index: gcc/testsuite/gfortran.dg/private_type_6.f90
===================================================================
*** gcc/testsuite/gfortran.dg/private_type_6.f90 (revision 138273)
--- gcc/testsuite/gfortran.dg/private_type_6.f90 (working copy)
*************** program foo_test
*** 19,25 ****
    TYPE(footype) :: foo
    TYPE(bartype) :: foo2
    foo  = footype(1) ! { dg-error "All components of 'footype' are PRIVATE" }
!   foo2 = bartype(1,2) ! { dg-error "'dummy2' is PRIVATE" }
    foo2%dummy2 = 5 ! { dg-error "is a PRIVATE component" }
  end program foo_test
  ! { dg-final { cleanup-modules "foomod" } }
--- 19,25 ----
    TYPE(footype) :: foo
    TYPE(bartype) :: foo2
    foo  = footype(1) ! { dg-error "All components of 'footype' are PRIVATE" }
!   foo2 = bartype(1,2) ! { dg-error "is a PRIVATE component" }
    foo2%dummy2 = 5 ! { dg-error "is a PRIVATE component" }
  end program foo_test
  ! { dg-final { cleanup-modules "foomod" } }
Index: gcc/testsuite/gfortran.dg/structure_constructor_7.f03
===================================================================
*** gcc/testsuite/gfortran.dg/structure_constructor_7.f03 (revision 138273)
--- gcc/testsuite/gfortran.dg/structure_constructor_7.f03 (working copy)
*************** PROGRAM test
*** 13,18 ****
    TYPE(basics_t) :: basics

    basics = basics_t (42, 1.5, 1000) ! { dg-error "Too many components" }
!   basics = basics_t (42, xxx = 1000) ! { dg-error "Component 'xxx'" }

  END PROGRAM test
--- 13,18 ----
    TYPE(basics_t) :: basics

    basics = basics_t (42, 1.5, 1000) ! { dg-error "Too many components" }
!   basics = basics_t (42, xxx = 1000) ! { dg-error "is not a member" }

  END PROGRAM test
Index: gcc/testsuite/gfortran.dg/structure_constructor_8.f03
===================================================================
*** gcc/testsuite/gfortran.dg/structure_constructor_8.f03 (revision 138273)
--- gcc/testsuite/gfortran.dg/structure_constructor_8.f03 (working copy)
*************** PROGRAM test
*** 47,54 ****
    struct2 = allpriv_t ()

    ! These should fail
!   struct1 = haspriv_t (1, 2) ! { dg-error "'b' is PRIVATE" }
!   struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "'b' is PRIVATE" }

    ! This should fail as all components are private
    struct2 = allpriv_t (5) ! { dg-error "of 'allpriv_t' are PRIVATE" }
--- 47,54 ----
    struct2 = allpriv_t ()

    ! These should fail
!   struct1 = haspriv_t (1, 2) ! { dg-error "is a PRIVATE component" }
!   struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "is a PRIVATE component" }

    ! This should fail as all components are private
    struct2 = allpriv_t (5) ! { dg-error "of 'allpriv_t' are PRIVATE" }

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

15 years agoMoved to gcc-interface directory.
charlet [Tue, 29 Jul 2008 20:43:33 +0000 (20:43 +0000)]
Moved to gcc-interface directory.

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

15 years ago2008-07-29 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Tue, 29 Jul 2008 19:34:36 +0000 (19:34 +0000)]
2008-07-29  Paolo Carlini  <paolo.carlini@oracle.com>

* include/debug/set.h: Minor formatting fixes.
* include/debug/multiset.h: Likewise.
* include/debug/safe_association.h: Likewise.
* include/debug/vector: Likewise.
* include/debug/map.h: Likewise.
* include/debug/string: Likewise.
* include/debug/multimap.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_bvector.h: Likewise.

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

15 years ago * trans.c (process_inlined_subprograms): Remove tree_really_inline
charlet [Tue, 29 Jul 2008 18:52:26 +0000 (18:52 +0000)]
* trans.c (process_inlined_subprograms): Remove tree_really_inline
check.

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

15 years agoMoved to gcc-interface.
charlet [Tue, 29 Jul 2008 18:51:30 +0000 (18:51 +0000)]
Moved to gcc-interface.

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

15 years ago * c-decl.c (merge_decls): Do not handle DECL_INLINE.
hubicka [Tue, 29 Jul 2008 17:10:55 +0000 (17:10 +0000)]
* c-decl.c (merge_decls): Do not handle DECL_INLINE.
(grokdeclarator): Likewise.
* langhooks.c (lhd_warn_unused_global_decl): Use
DECL_DECLARED_INLINE_P.
* print-tree.c (print_node): Remove DECL_INLINE check.

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

15 years ago2008-07-29 Richard Guenther <rguenther@suse.de>
rguenth [Tue, 29 Jul 2008 17:09:26 +0000 (17:09 +0000)]
2008-07-29  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/36945
* tree-ssa-sccvn.h (copy_reference_ops_from_ref): Declare.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Export.
Record invariant addresses un-decomposed.
(copy_reference_ops_from_call): Record reference call
arguments properly.  Simplify.
* tree-ssa-pre.c (create_component_ref_by_pieces_1): New
helper split out from ...
(create_component_ref_by_pieces): ... here.  Simplify.
Prepare for recursive invocation for call arguments.
(create_expression_by_pieces): Adjust call to
create_component_ref_by_pieces.
(compute_avail): Process operand 2 of reference ops.

* gcc.dg/tree-ssa/ssa-pre-18.c: New testcase.

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

15 years ago2008-07-29 Richard Guenther <rguenther@suse.de>
rguenth [Tue, 29 Jul 2008 17:07:42 +0000 (17:07 +0000)]
2008-07-29  Richard Guenther  <rguenther@suse.de>

* gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for
OBJ_TYPE_REF.

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

15 years ago2008-07-29 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Tue, 29 Jul 2008 17:06:24 +0000 (17:06 +0000)]
2008-07-29  Paolo Carlini  <paolo.carlini@oracle.com>

* include/std/utility: Include <initializer_list>, per the current WP.

* testsuite/lib/libstdc++.exp (check_v3_target_cstdint): Tweak,
don't use -std=gnu++0x unnecessarily.
* testsuite/18_support/numeric_limits/char16_32_t.cc: Use
dg-require-cstdint.
* testsuite/18_support/headers/cstdint/types_std_c++0x.cc: Likewise.
* testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc: Likewise.

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

15 years ago * trans.c (process_inlined_subprograms): Remove tree_really_inline
hubicka [Tue, 29 Jul 2008 17:02:45 +0000 (17:02 +0000)]
* trans.c (process_inlined_subprograms): Remove tree_really_inline
check.

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

15 years ago * class.c (build_utf8_ref): Set DECL_SIZE and DECL_SIZE_UNIT
jakub [Tue, 29 Jul 2008 16:31:18 +0000 (16:31 +0000)]
* class.c (build_utf8_ref): Set DECL_SIZE and DECL_SIZE_UNIT
from ctype's sizes.

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

15 years ago * class.c (build_utf8_ref): Pad initializer string to utf8const_type's
jakub [Tue, 29 Jul 2008 16:30:32 +0000 (16:30 +0000)]
* class.c (build_utf8_ref): Pad initializer string to utf8const_type's
alignment.

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

15 years ago PR c++/36852
jakub [Tue, 29 Jul 2008 16:29:33 +0000 (16:29 +0000)]
PR c++/36852
* tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
TYPE_UID instead of pointers.

* g++.dg/pch/array-1.C: New test.
* g++.dg/pch/array-1.Hs: New file.

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

15 years ago * c-format.c (check_format_types): Revert unwanted checkin.
jakub [Tue, 29 Jul 2008 16:27:50 +0000 (16:27 +0000)]
* c-format.c (check_format_types): Revert unwanted checkin.

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

15 years agoResync.
charlet [Tue, 29 Jul 2008 15:50:16 +0000 (15:50 +0000)]
Resync.

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

15 years ago * gcc-interface: New directory.
charlet [Tue, 29 Jul 2008 15:46:37 +0000 (15:46 +0000)]
* gcc-interface: New directory.

* ada-tree.def, cuintp.c, gigi.h, Makefile.in, targtyps.c, ada.h,
utils.c, ada-tree.h, decl.c, lang.opt, Make-lang.in, trans.c,
config-lang.in, deftarg.c, lang-specs.h, misc.c, utils2.c: Moved
to gcc-interface subdirectory.

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

15 years ago2008-07-29 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
aaronwl [Tue, 29 Jul 2008 14:10:03 +0000 (14:10 +0000)]
2008-07-29  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

* Makefile.in (EXTRA_GNATRTL_NONTASKING_OBJS): Remove extra s-win32.o.

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

15 years ago * flags.h (flag_really_no_inline): Remove.
hubicka [Tue, 29 Jul 2008 11:00:58 +0000 (11:00 +0000)]
* flags.h (flag_really_no_inline): Remove.
* cgraph.c (cgraph_function_possibly_inlined_p): Simplify.
* toplev.c (flag_really_no_inline): Remove.
* c-cppbuiltin.c (c_cpp_builtins): Use flag_no_inline.
* ipa-inline.c (cgraph_decide_inlining): Do not check flag_no_inline.
(cgraph_decide_inlining_incrementally): Likewise.
(compute_inline_parameters): Likewise.
* opts.c (decode_options): Simplify.
* c-opts.c (c_common_post_options): Do not set flag_no_inline.
* common.opt (finline): Initialize to 1.
* tree-inline.c (inlinable_function_p): Check flag_no_inline.

* lang.c (java_post_options): Remove handling of flag_no_inline.

* misc.c (gnat_post_options): Do not set flag_no_inline.

* options.c (gfc_post_options): Do not set flag_no_inline.

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

15 years ago * predict.c (always_optimize_for_size_p): New function.
hubicka [Tue, 29 Jul 2008 10:52:16 +0000 (10:52 +0000)]
* predict.c (always_optimize_for_size_p): New function.
(optimize_bb_for_size_p, optimize_bb_for_speed_p,
optimize_edge_for_size_p, optimize_edge_for_speed_p,
optimize_insn_for_size_p, optimize_insn_for_speed_p): New global
functions.
(rtl_profile_for_bb, rtl_profile_for_edge, rtl_default_profile): New.
* function.c (prepare_function_start): Set default profile.
* function.h (rtl_data): Add maybe_hot_insn_p.
* cfgexpand.c (expand_gimple_basic_block): Set RTL profile.
(construct_exit_block): Likewise.
(tree_expand_cfg): Likewise.
* basic-block.h
(optimize_bb_for_size_p, optimize_bb_for_speed_p,
optimize_edge_for_size_p, optimize_edge_for_speed_p,
optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
(rtl_profile_for_bb, rtl_profile_for_edge, default_rtl_profile):
Declare.

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

15 years ago * optimize.c (maybe_clone_body): Remove DECL_INLINE.
hubicka [Tue, 29 Jul 2008 10:49:30 +0000 (10:49 +0000)]
  * optimize.c (maybe_clone_body): Remove DECL_INLINE.
* decl.c (duplicate_decls): Likewise.
(grokfndecl): Likewise.
(start_method): Likewise.
* method.c (make_thunk, make_alias_for, implicitly_declare_fn):
Likewise.
* pt.c (register_specialization, regenerate_decl_from_template):
Likewise.
* decl2.c (grokfield): Likewise.

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

15 years ago2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
manu [Tue, 29 Jul 2008 10:00:25 +0000 (10:00 +0000)]
2008-07-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR 34985
* c-decl.c (merge_decls): Merge USED flags.
cp/
* decl.c (duplicate_decls): Merge USED flags.
testsuite/
* gcc.dg/pr34985.c: New.
* g++.dg/warn/pr34985.C: New.

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

15 years ago2008-07-29 Daniel Kraft <d@domob.eu>
domob [Tue, 29 Jul 2008 09:11:51 +0000 (09:11 +0000)]
2008-07-29  Daniel Kraft  <d@domob.eu>

PR fortran/36403
* trans-intrinsic.c (conv_generic_with_optional_char_arg):  New method
to append a string-length even if the string argument is missing, e.g.
for EOSHIFT.
(gfc_conv_intrinsic_function):  Call the new method for EOSHIFT, PACK
and RESHAPE.

2008-07-29  Daniel Kraft  <d@domob.eu>

PR fortran/36403
* gfortran.dg/char_eoshift_5.f90:  New test.
* gfortran.dg/intrinsic_optional_char_arg_1.f90:  New test.

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

15 years ago * config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
kkojima [Tue, 29 Jul 2008 09:07:49 +0000 (09:07 +0000)]
* config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
valist, next_fp, next_fp_tmp, next_fp_limit, next_o, next_o_limit,
next_stack, lab_false and lab_over trees.

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

15 years ago * gfortran.h (try): Remove macro. Replace try with gfc_try
ghazi [Tue, 29 Jul 2008 00:45:52 +0000 (00:45 +0000)]
* gfortran.h (try): Remove macro.  Replace try with gfc_try
throughout.
* array.c: Likewise.
* check.c: Likewise.
* cpp.c: Likewise.
* cpp.h: Likewise.
* data.c: Likewise.
* data.h: Likewise.
* decl.c: Likewise.
* error.c: Likewise.
* expr.c: Likewise.
* interface.c: Likewise.
* intrinsic.c: Likewise.
* intrinsic.h: Likewise.
* io.c: Likewise.
* match.h: Likewise.
* parse.c: Likewise.
* parse.h: Likewise.
* resolve.c: Likewise.
* scanner.c: Likewise.
* simplify.c: Likewise.
* symbol.c: Likewise.
* trans-openmp.c: Likewise.
* trans-types.c: Likewise.

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

15 years agoDaily bump.
gccadmin [Tue, 29 Jul 2008 00:16:58 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago PR c++/36943
jason [Tue, 29 Jul 2008 00:06:08 +0000 (00:06 +0000)]
    PR c++/36943
        * decl.c (reshape_init_r): Allow C++0x initializer lists.

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

15 years ago2008-07-28 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Mon, 28 Jul 2008 23:28:16 +0000 (23:28 +0000)]
2008-07-28  Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/36949
* include/tr1_impl/boost_shared_ptr.h
(__shared_ptr(_Sp_make_shared_tag, _Alloc, _Args&&...): Call
__enable_shared_from_this_helper.
* testsuite/20_util/shared_ptr/creation/36949.cc: New.

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

15 years ago2008-07-28 Richard Guenther <rguenther@suse.de>
rguenth [Mon, 28 Jul 2008 20:32:32 +0000 (20:32 +0000)]
2008-07-28  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/36957
* tree-flow.h (tree_ssa_useless_type_conversion): Remove.
(useless_type_conversion_p): Remove.
(types_compatible_p): Remove.
* gimple.h (tree_ssa_useless_type_conversion): Declare.
(useless_type_conversion_p): Declare.
(types_compatible_p): Declare.
(gimple_expr_type): Return the base type only if it is
trivially convertible to the subtype.

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

15 years ago2008-07-28 Andreas Tobler <a.tobler@schweiz.org>
andreast [Mon, 28 Jul 2008 20:30:00 +0000 (20:30 +0000)]
2008-07-28  Andreas Tobler  <a.tobler@schweiz.org>

* configure.ac: Use the m4_do macro to concatenate the warnings into
one string in ACX_PROG_CC_WARNING_OPTS,
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and ACX_PROG_CC_WARNINGS_ARE_ERRORS.
* configure: Regenerate.

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

15 years agofix typo
aldyh [Mon, 28 Jul 2008 19:50:50 +0000 (19:50 +0000)]
fix typo

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

15 years ago* configure.tgt: Enable futex for MIPS.
chaoyingfu [Mon, 28 Jul 2008 18:47:44 +0000 (18:47 +0000)]
* configure.tgt: Enable futex for MIPS.
* config/linux/mips/futex.h: New file.

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

15 years ago2008-07-28 Richard Guenther <rguenther@suse.de>
rguenth [Mon, 28 Jul 2008 18:29:04 +0000 (18:29 +0000)]
2008-07-28  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (insert_into_preds_of_block): Remove dead code.
(insert_fake_stores): Remove.
(realify_fake_stores): Likewise.
(execute_pre): Remove dead code.
* tree-ssa-structalias.c (get_constraint_for_1): Remove tcc_unary
case.
(find_func_aliases): Deal with it here instead.
Re-enable gcc_unreachable call.

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

15 years ago * MAINTAINERS: Add Jakub and myself as gimple maintainers.
aldyh [Mon, 28 Jul 2008 17:37:05 +0000 (17:37 +0000)]
    * MAINTAINERS: Add Jakub and myself as gimple maintainers.

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

15 years ago2008-07-28 Tobias Burnus <burnus@net-b.de>
burnus [Mon, 28 Jul 2008 16:02:51 +0000 (16:02 +0000)]
2008-07-28  Tobias Burnus  <burnus@net-b.de>

       * Make-lang.in: Remove -Wno-* from fortran-warn.

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

15 years ago2008-07-28 Richard Guenther <rguenther@suse.de>
rguenth [Mon, 28 Jul 2008 14:33:56 +0000 (14:33 +0000)]
2008-07-28  Richard Guenther  <rguenther@suse.de>

Merge from gimple-tuples-branch.

* ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
* gimple.def: New file.
* gsstruct.def: Likewise.
* gimple-iterator.c: Likewise.
* gimple-pretty-print.c: Likewise.
* tree-gimple.c: Removed.  Merged into ...
* gimple.c: ... here.  New file.
* tree-gimple.h: Removed.  Merged into ...
* gimple.h: ... here.  New file.

* Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h.
* configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the
--enable-checking=gimple flag.
* config.in: Likewise.
* configure: Regenerated.

* tree-ssa-operands.h: Tuplified.
* tree-vrp.c: Likewise.
* tree-loop-linear.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-ssa-loop-im.c: Likewise.
* tree-dump.c: Likewise.
* tree-complex.c: Likewise.
* cgraphbuild.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-pretty-print.c: Likewise.
* tracer.c: Likewise.
* gengtype.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-ssa-loop-unswitch.c: Likewise.
* cgraph.c: Likewise.
* cgraph.h: Likewise.
* tree-ssa-loop-manip.c: Likewise.
* value-prof.c: Likewise.
* tree-ssa-loop-ch.c: Likewise.
* tree-tailcall.c: Likewise.
* value-prof.h: Likewise.
* tree.c: Likewise.
* tree.h: Likewise.
* tree-pass.h: Likewise.
* ipa-cp.c: Likewise.
* tree-scalar-evolution.c: Likewise.
* tree-scalar-evolution.h: Likewise.
* target.h: Likewise.
* lambda-mat.c: Likewise.
* tree-phinodes.c: Likewise.
* diagnostic.h: Likewise.
* builtins.c: Likewise.
* tree-ssa-alias-warnings.c: Likewise.
* cfghooks.c: Likewise.
* fold-const.c: Likewise.
* cfghooks.h: Likewise.
* omp-low.c: Likewise.
* tree-ssa-dse.c: Likewise.
* ipa-reference.c: Likewise.
* tree-ssa-uncprop.c: Likewise.
* toplev.c: Likewise.
* tree-gimple.c: Likewise.
* tree-gimple.h: Likewise.
* tree-chrec.c: Likewise.
* tree-chrec.h: Likewise.
* tree-ssa-sccvn.c: Likewise.
* tree-ssa-sccvn.h: Likewise.
* cgraphunit.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-nomudflap.c: Likewise.
* tree-call-cdce.c: Likewise.
* ipa-pure-const.c: Likewise.
* c-format.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-ssa-math-opts.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-nrv.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* ipa-utils.c: Likewise.
* tree-ssa-propagate.h: Likewise.
* tree-ssa-alias.c: Likewise.
* gimple-low.c: Likewise.
* tree-ssa-sink.c: Likewise.
* ipa-inline.c: Likewise.
* c-semantics.c: Likewise.
* dwarf2out.c: Likewise.
* expr.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* predict.c: Likewise.
* tree-ssa-loop.c: Likewise.
* tree-parloops.c: Likewise.
* tree-ssa-address.c: Likewise.
* tree-ssa-ifcombine.c: Likewise.
* matrix-reorg.c: Likewise.
* c-decl.c: Likewise.
* tree-eh.c: Likewise.
* c-pretty-print.c: Likewise.
* lambda-trans.c: Likewise.
* function.c: Likewise.
* langhooks.c: Likewise.
* ebitmap.h: Likewise.
* tree-vectorizer.c: Likewise.
* function.h: Likewise.
* langhooks.h: Likewise.
* tree-vectorizer.h: Likewise.
* ipa-type-escape.c: Likewise.
* ipa-type-escape.h: Likewise.
* domwalk.c: Likewise.
* tree-if-conv.c: Likewise.
* profile.c: Likewise.
* domwalk.h: Likewise.
* tree-data-ref.c: Likewise.
* tree-data-ref.h: Likewise.
* tree-flow-inline.h: Likewise.
* tree-affine.c: Likewise.
* tree-vect-analyze.c: Likewise.
* c-typeck.c: Likewise.
* gimplify.c: Likewise.
* coretypes.h: Likewise.
* tree-ssa-phiopt.c: Likewise.
* calls.c: Likewise.
* tree-ssa-coalesce.c: Likewise.
* tree.def: Likewise.
* tree-dfa.c: Likewise.
* except.c: Likewise.
* except.h: Likewise.
* cfgexpand.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-ssa-pre.c: Likewise.
* tree-ssa-live.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-live.h: Likewise.
* tree-predcom.c: Likewise.
* lambda.h: Likewise.
* tree-mudflap.c: Likewise.
* ipa-prop.c: Likewise.
* print-tree.c: Likewise.
* tree-ssa-copy.c: Likewise.
* ipa-prop.h: Likewise.
* tree-ssa-forwprop.c: Likewise.
* ggc-page.c: Likewise.
* c-omp.c: Likewise.
* tree-ssa-dce.c: Likewise.
* tree-vect-patterns.c: Likewise.
* tree-ssa-ter.c: Likewise.
* tree-nested.c: Likewise.
* tree-ssa.c: Likewise.
* lambda-code.c: Likewise.
* tree-ssa-loop-prefetch.c: Likewise.
* tree-inline.c: Likewise.
* tree-inline.h: Likewise.
* tree-iterator.c: Likewise.
* tree-optimize.c: Likewise.
* tree-ssa-phiprop.c: Likewise.
* tree-vect-transform.c: Likewise.
* tree-object-size.c: Likewise.
* tree-outof-ssa.c: Likewise.
* cfgloop.c: Likewise.
* system.h: Likewise.
* tree-profile.c: Likewise.
* cfgloop.h: Likewise.
* c-gimplify.c: Likewise.
* c-common.c: Likewise.
* tree-vect-generic.c: Likewise.
* tree-flow.h: Likewise.
* c-common.h: Likewise.
* basic-block.h: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-switch-conversion.c: Likewise.
* tree-ssa-structalias.h: Likewise.
* tree-cfg.c: Likewise.
* passes.c: Likewise.
* ipa-struct-reorg.c: Likewise.
* ipa-struct-reorg.h: Likewise.
* tree-ssa-reassoc.c: Likewise.
* cfgrtl.c: Likewise.
* varpool.c: Likewise.
* stmt.c: Likewise.
* tree-ssanames.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* langhooks-def.h: Likewise.
* tree-ssa-operands.c: Likewise.
* config/alpha/alpha.c: Likewise.
* config/frv/frv.c: Likewise.
* config/s390/s390.c: Likewise.
* config/m32c/m32c.c: Likewise.
* config/m32c/m32c-protos.h: Likewise.
* config/spu/spu.c: Likewise.
* config/sparc/sparc.c: Likewise.
* config/i386/i386.c: Likewise.
* config/sh/sh.c: Likewise.
* config/xtensa/xtensa.c: Likewise.
* config/stormy16/stormy16.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/pa/pa.c: Likewise.
* config/mips/mips.c: Likewise.

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

15 years ago * c-pragma.c (handle_pragma_message): New function.
simonb [Mon, 28 Jul 2008 11:55:11 +0000 (11:55 +0000)]
* c-pragma.c (handle_pragma_message): New function.
(init_pragma): Register handle_pragma_message.
* doc/extend.texi (Diagnostic Pragmas): Added #pragma message
documentation.

* gcc.dg/pragma-message.c: New.

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

15 years agoDaily bump.
gccadmin [Mon, 28 Jul 2008 00:16:51 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago2008-07-27 Victor Kaplansky <victork@il.ibm.com>
victork [Sun, 27 Jul 2008 21:44:25 +0000 (21:44 +0000)]
2008-07-27  Victor Kaplansky  <victork@il.ibm.com>

        PR tree-optimization/35252
        * tree-vect-analyze.c (vect_build_slp_tree): Make IMAGPART_EXPR and
        REALPART_EXPR to be considered as same load operation.

testsuite

        PR tree-optimization/35252
        * gcc.dg/vect/vect-complex-1.c, gcc.dg/vect/vect-complex-2.c,
        gcc.dg/vect/fast-math-vect-complex-3.c,
        gcc.dg/vect/vect-complex-4.c: New tests.

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

15 years agogcc/cp/
hjl [Sun, 27 Jul 2008 17:40:04 +0000 (17:40 +0000)]
gcc/cp/

2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/36944
* class.c (type_has_user_provided_default_constructor): Handle
default parameters.

gcc/testsuite/

2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/36944
* g++.dg/other/pr36944.C: New.

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

15 years ago PR tree-optimization/36830
ebotcazou [Sun, 27 Jul 2008 16:55:31 +0000 (16:55 +0000)]
PR tree-optimization/36830
* tree-ssa-sccvn.c (vn_reference_op_compute_hash): Hash operand #2.
(expressions_equal_p): Return false if only one operand is null.

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

15 years ago2008-07-27 Daniel Franke <franke.daniel@gmail.com>
dfranke [Sun, 27 Jul 2008 16:32:14 +0000 (16:32 +0000)]
2008-07-27  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/36724
* gfortran.dg/pointer_to_substring.f90: New test.

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

15 years ago2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Sun, 27 Jul 2008 15:49:12 +0000 (15:49 +0000)]
2008-07-27  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (push_library_fn): Add a parameter for the exceptions that
the function may throw.
(push_void_library_fn, push_throw_library_fn, expand_static_init):
Adjust.
(build_library_fn): Change to static.
* cp-tree.h: Adjust declarations.
* except.c (declare_nothrow_library_fn): New.
(do_get_exception_ptr, do_begin_catch, do_free_exception,
do_allocate_exception):  Use the latter, adjust the declarations
(ie, add empty exception-specification), consistently with the
actual implementation in libsupc++.

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

15 years ago2008-07-27 Tobias Burnus <burnus@net-b.de>
burnus [Sun, 27 Jul 2008 10:45:44 +0000 (10:45 +0000)]
2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        * trans.c (gfc_trans_runtime_check): Allow run-time warning
        * besides
        run-time error.
        * trans.h (gfc_trans_runtime_check): Update declaration.
        * trans-array.c
        * (gfc_trans_array_ctor_element,gfc_trans_array_bound_check,
        gfc_conv_array_ref,gfc_conv_ss_startstride,gfc_trans_dummy_array_bias):
        Updated gfc_trans_runtime_check calls.
        (gfc_conv_array_parameter): Implement flag_check_array_temporaries,
        fix packing/unpacking for nonpresent optional actuals to optional
        formals.
        * trans-array.h (gfc_conv_array_parameter): Update declaration.
        * trans-expr.c (gfc_conv_substring,gfc_trans_arrayfunc_assign,
        gfc_conv_function_call): Updated gfc_trans_runtime_check calls.
        (gfc_conv_function_call): Update gfc_conv_array_parameter calls.
        * trans-expr.c (gfc_trans_goto): Updated gfc_trans_runtime_check
        calls.
        * trans-io.c (set_string,gfc_conv_intrinsic_repeat): Ditto.
        (gfc_conv_intrinsic_transfer,gfc_conv_intrinsic_loc): Same for
        gfc_conv_array_parameter.
        * trans-intrinsics.c (gfc_conv_intrinsic_bound): Ditto.
        * trans-decl.c (gfc_build_builtin_function_decls): Add
        gfor_fndecl_runtime_warning_at.
        * lang.opt: New option fcheck-array-temporaries.
        * gfortran.h (gfc_options): New flag_check_array_temporaries.
        * options.c (gfc_init_options, gfc_handle_option): Handle flag.
        * invoke.texi: New option fcheck-array-temporaries.

2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        * runtime/error.c: New function runtime_error_at.
        * gfortran.map: Ditto.
        * libgfortran.h: Ditto.

2008-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36132
        PR fortran/29952
        PR fortran/36909
        gfortran.dg/internal_pack_4.f90: New.
        gfortran.dg/internal_pack_5.f90: New.
        gfortran.dg/array_temporaries_2.f90: New.

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

15 years agoDaily bump.
gccadmin [Sun, 27 Jul 2008 00:16:44 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago * doc/install.texi (powerpc-*-netbsd*): Remove redundant texinfo
gerald [Sat, 26 Jul 2008 21:41:15 +0000 (21:41 +0000)]
* doc/install.texi (powerpc-*-netbsd*): Remove redundant texinfo
version requirements.

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

15 years agoFix nits.
ebotcazou [Sat, 26 Jul 2008 19:03:37 +0000 (19:03 +0000)]
Fix nits.

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

15 years ago * collect2.c (symkind): New enum. Symbol kinds we care about.
hainque [Sat, 26 Jul 2008 14:26:45 +0000 (14:26 +0000)]
* collect2.c (symkind): New enum.  Symbol kinds we care about.
(is_ctor_dtor): Return symkind instead of int.  Adjust prototype,
code and head comment accordingly.
(scan_prog_file): Use symkind names instead of bare integers.

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

15 years ago2008-07-26 Thomas Koenig <tkoenig@gcc.gnu.org>
tkoenig [Sat, 26 Jul 2008 10:30:50 +0000 (10:30 +0000)]
2008-07-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/36934
* gfortran.dg/allocatable_module_1.f90:  New test case.

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

15 years ago * cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
hubicka [Sat, 26 Jul 2008 10:03:01 +0000 (10:03 +0000)]
* cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
* cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE
(cgraph_preserve_function_body_p): Do not rely on DECL_INLINE.
* dojump.c (clear_pending_stack_adjust): Likewise.
* print-tree.c (print_node): Ignore DECL_INLINE.
* tree-inline.c (inlinable_function_p): Likewise.

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

15 years agoDaily bump.
gccadmin [Sat, 26 Jul 2008 00:16:56 +0000 (00:16 +0000)]
Daily bump.

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

15 years agoFix IA-64 breakage; Make hot/cold optimization conversation port specific; Move disab...
meissner [Fri, 25 Jul 2008 23:44:24 +0000 (23:44 +0000)]
Fix IA-64 breakage; Make hot/cold optimization conversation port specific; Move disabling of scheduling from OVERRIDE_OPTIONS to OPTIMIZATION_OPTIONS

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

15 years agoFix changelog entry of my earlier commit.
hubicka [Fri, 25 Jul 2008 21:05:23 +0000 (21:05 +0000)]
Fix changelog entry of my earlier commit.

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

15 years ago * typeck.c (inline_conversion): Remove.
hubicka [Fri, 25 Jul 2008 21:03:34 +0000 (21:03 +0000)]
* typeck.c (inline_conversion): Remove.
(cp_build_function_call): Do not use inline_conversion.
* decl.c (duplicate_decls): Do not insist on inline being declared
early.
(start_cleanup_fn): Do not assume that INLINE flags prevent function
from being output.  We now remove static functions always.
(finish_function): Do return warning on all static functions.
* call.c (build_over_call): Do not use inline_conversion.
* cp-tree.h (possibly_inlined_p): Declare.
(inline_conversion): Remove.
* pt.c (instantiate_decl): Use possibly_inlined_p predicate.
* decl2.c (cp_write_global_declarations): Likewise.
(mark_used): Likewise.
(possibly_inlined_p): New functions.

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

15 years ago2008-07-25 Martin Jambor <mjambor@suse.cz>
hjl [Fri, 25 Jul 2008 20:30:35 +0000 (20:30 +0000)]
2008-07-25  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/36926
* ipa-prop.c (ipa_analyze_call_uses): Call
ipa_is_ssa_with_stmt_def instead of SSA_NAME_IS_DEFAULT_DEF.

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

15 years ago * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
jsm28 [Fri, 25 Jul 2008 16:21:05 +0000 (16:21 +0000)]
* config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
movv2si_internal): Add mem = reg alternative.

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

15 years ago2008-07-25 Andreas Tobler <a.tobler@schweiz.org>
andreast [Fri, 25 Jul 2008 15:59:12 +0000 (15:59 +0000)]
2008-07-25  Andreas Tobler  <a.tobler@schweiz.org>

PR bootstrap/36918
* config/sparc/sparc.h (DEFAULT_PCC_STRUCT_RETURN): Define
DEFAULT_PCC_STRUCT_RETURN to 127.

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

15 years ago * lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
jsm28 [Fri, 25 Jul 2008 15:49:36 +0000 (15:49 +0000)]
* lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
New.
* g++.dg/inherit/thunk8.C: Use it.

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

15 years ago * class.c (type_has_user_provided_default_constructor): Handle
jason [Fri, 25 Jul 2008 15:18:16 +0000 (15:18 +0000)]
    * class.c (type_has_user_provided_default_constructor): Handle
        templates.

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

15 years agoRemove files that was intended to be removed in last commit.
hubicka [Fri, 25 Jul 2008 14:25:39 +0000 (14:25 +0000)]
Remove files that was intended to be removed in last commit.

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

15 years ago * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
hubicka [Fri, 25 Jul 2008 13:11:32 +0000 (13:11 +0000)]
* cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
(build_cgraph_edges): Likewise.
* cgraph.c (cgraph_node): Do not update assembler hash.
(cgraph_remove_node): Drop non-unit-at-a-time code.
* tree-pass.h (pass_O0_always_inline): Remove.
* ipa-reference.c (gate_reference): Remove unit-at-a-time check.
* toplev.c (process_options): Flag unit-at-a-time does not imply
no section anchors.
* cgraphunit.c: Update comments.
(decide_is_function_needed): Drop non-unit-at-a-time mode.
(cgraph_assemble_pending_functions): Remove.
(cgraph_reset_node): Drop non-unit-at-a-time code.
(cgraph_finalize_function): Likewise.
(cgraph_analyze_function): Likewise.
(cgraph_finalize_compilation_unit): Likewise.
(cgraph_expand_function): Likewise.
(cgraph_optimize): Likesise.
(save_inline_function_body): Likewise.
* ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check.
* tree-ssa-alias.c (maybe_be_aliased): Likewise.
* ipa-inline.c: Update comments.
(enum inlining_mode): remove INLINE_SPEED.
(cgraph_clone_inlined_nodes): Drop unit-at-a-time check.
(cgraph_mark_inline_edge): Likewise.
(try_inline): Likewise.
(cgraph_decide_inlining_incrementally): Likewise.
(cgraph_gate_inlining): Remove.
(cgraph_early_inlining): Remove flag_unit_at_a_time checks.
(cgraph_gate_early_inlining): Likewise.
(gate_inline_passes): Remove.
(pass_inline_parameters, pass_ipa_inline): Remove gates.
(cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
pass_O0_always_inline): Remove.
* c-pch.c (c_pch_matching): Remove -funit-at-a-time.
* dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
* opts.c (no_unit_at_a_time_default): Remove.
(decode_options): Remove flag_unit_at_a_time reset and warning.
* opts.h (no_unit_at_a_time_default): Remove.
* c-decl.c (diagnose_mismatched_decls): Do not require inline keyword
early in GNU dialect.
(merge_decls): Update comment; drop unit-at-a-time check.
(finish_decl): Likewise.
(grok_declaration): Remove flag_inline_trees code.
(finish_functions): Return on function returning non-void on all
statics.
* ipa-tye-escape.c (gate_type_escape_vars): Remove.
* cfgexpand.c (expand_one_static_var): Remove.
(expand_one_var): Remove expand_one_static_var call.
(expand_used_vars_for_block): Remove flag_unit_a_time check.
* c-opts.c (c_common_post_options): Remove flag_inline_trees code
and flag_unit_at_a-time compatibility checks.
* varasm.c (assemble_alias): Remove flag_unit_at_a_time check.
* tree-inline.c (flag_inline_trees): Remove.
(inlinable_function_p): Don't check it.
(expand_call_inline): Remove non-unit-at-a-time code.
* tree-inline.h (flag_inline_trees): Remove.
* tree-optimize.c (execute_early_local_optimizations): Remove
unit-at-a-time checks.
(tree_rest_of_compilation): Likewise.
* combine.c (setup_incoming_promotions): Likewise.
* tree-profile.c (tree_gen_ic_func_profiler): Likewise.
* tree-ssa-structalias.c (delete_points_to_sets): Likewise.
* passes.c (pass_inline_parameters): Update comments; remove
O0_alwaysinline pass.
(execute_one_ipa_transform_pass): Do not reset in_gimple_form.
(execute_one_pass): Likewise.
* i386.c (ix86_function_regparm): Remove unit-at-a-time check.
(ix86_function_sseregparm): Likewise.
* arm.c (arm_function_in_section_p): Likewise.
* bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise.
* varpool.c: Update comments.
(decide_is_variable_needed): Remove unit-at-a-time checks.
(varpool_finalize_decl): Likewise.

* ada/utils.c (end_subprog_body): Remove inline trees check.
* ada/misc.c (gnat_post_options): Do not set flag_inline_trees.

* fortran/options.c (gfc_post_options): Remove flag_unline_trees code.

* gcc.dg/winline-4.c: Remove.
* gcc.dg/pch/valid-3.hs: Remove.
* gcc.dg/pch/valid-3.c: Remove.
* g++.old-deja/g++.brendan/crash52.C: Accept returning void warning
* g++.old-deja/g++.jason/report.C: Likewise.
* testsuite/g++.dg/warn/pr23075.C: We get returning void warning
instead of control flow warning.

* cp/decl.c (duplicate_decls): Update comment and unit-at-a-time.
(grogfndecl): Drop flag_inline_trees code.
* cp/pt.c (instantiate_decl): Drop flag_iline_trees code.
* cp/lex.c (cxx_init): Do not set unit-at-a-time.

* java/decl.c: Include cgraph.h
(end_java_method): Remove non-unit-at-a-time code.
(java_mark_decl_local): Likewise; sanity check that we don't touch
finalized nodes.

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

15 years ago * raise-gcc.c: Move tsystem.h before tm.h.
ro [Fri, 25 Jul 2008 12:27:29 +0000 (12:27 +0000)]
* raise-gcc.c: Move tsystem.h before tm.h.

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

15 years agoDaily bump.
gccadmin [Fri, 25 Jul 2008 00:16:48 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago * config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
kkojima [Fri, 25 Jul 2008 00:14:57 +0000 (00:14 +0000)]
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
to 2 instead of -1.
(OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal
to 2.

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

15 years ago2008-07-24 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Thu, 24 Jul 2008 22:47:26 +0000 (22:47 +0000)]
2008-07-24  Paolo Carlini  <paolo.carlini@oracle.com>

       PR libstdc++/36924
       Revert:
       2008-07-23  Chris Fairles <chris.fairles@gmail.com>

       * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
       Holds the lib that defines clock_gettime (-lrt or -lposix4).
       * src/Makefile.am: Use it.
       * configure: Regenerate.
       * configure.in: Likewise.
       * Makefile.in: Likewise.
       * src/Makefile.in: Likewise.
       * libsup++/Makefile.in: Likewise.
       * po/Makefile.in: Likewise.
       * doc/Makefile.in: Likewise.

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

15 years ago Implement defaulted/deleted functions as per N2346
jason [Thu, 24 Jul 2008 19:15:00 +0000 (19:15 +0000)]
    Implement defaulted/deleted functions as per N2346
        * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
        (DECL_DELETED_FN): New macro.
        (DECL_DEFAULTED_FN): New macro.
        * class.c (user_provided_p): New fn.
        (defaultable_fn_p): New fn.
        (type_has_user_provided_constructor): New fn.
        (type_has_user_provided_default_constructor): New fn.
        (check_methods): A defaulted fn is still trivial.
        (check_bases_and_members): Likewise.
        * decl.c (grok_special_member_properties): Likewise.
        (duplicate_decls): Complain about redeclaring a function as deleted.
        (start_decl): initialized==2 means deleted.
        (cp_finish_decl): Handle deleted/defaulted semantics.
        * decl2.c (grokfield): Likewise.
        (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
        Complain about using a deleted fn.
        * init.c (build_value_init_1): Use type_has_user_provided_constructor.
        (perform_member_init): Check for a user-provided default constructor
        even if TYPE_NEEDS_CONSTRUCTING.
        (build_new_1): Likewise.
        * call.c (build_over_call): Don't call mark_used twice.
        * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
        * search.c (check_final_overrider): Check for deleted mismatch.
        * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
        (cp_parser_pure_specifier): Handle =default and =delete.

        * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.

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

15 years ago2008-07-24 Daniel Kraft <d@domob.eu>
domob [Thu, 24 Jul 2008 18:52:51 +0000 (18:52 +0000)]
2008-07-24  Daniel Kraft  <d@domob.eu>

PR fortran/33141
* lang.opt (Wnonstd-intrinsics):  Removed option.
(Wintrinsics-std), (Wintrinsic-shadow):  New options.
* invoke.texi (Option Summary):  Removed -Wnonstd-intrinsics
from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
(Error and Warning Options):  Documented the new options and removed
the documentation for -Wnonstd-intrinsics.
* gfortran.h (gfc_option_t):  New members warn_intrinsic_shadow and
warn_intrinsics_std, removed warn_nonstd_intrinsics.
(gfc_is_intrinsic):  Renamed from gfc_intrinsic_name.
(gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard):  New.
* decl.c (match_procedure_decl):  Replaced gfc_intrinsic_name by
the new name gfc_is_intrinsic.
(warn_intrinsic_shadow):  New helper method.
(gfc_match_function_decl), (gfc_match_subroutine):  Call the new method
warn_intrinsic_shadow to check the just-parsed procedure.
* expr.c (check_init_expr):  Call new gfc_is_intrinsic to check whether
the function called is really an intrinsic in the selected standard.
* intrinsic.c (gfc_is_intrinsic):  Renamed from gfc_intrinsic_name and
extended to take into account the selected standard settings when trying
to find out whether a symbol is an intrinsic or not.
(gfc_check_intrinsic_standard):  Made public and extended.
(gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface):  Removed
the calls to check_intrinsic_standard, this check now happens inside
gfc_is_intrinsic.
(gfc_warn_intrinsic_shadow):  New method defined.
* options.c (gfc_init_options):  Initialize new warning flags to false
and removed intialization of Wnonstd-intrinsics flag.
(gfc_post_options):  Removed logic for Wnonstd-intrinsics flag.
(set_Wall):  Set new warning flags and removed Wnonstd-intrinsics flag.
(gfc_handle_option):  Handle the new flags and removed handling of the
old Wnonstd-intrinsics flag.
* primary.c (gfc_match_rvalue):  Replaced call to gfc_intrinsic_name by
the new name gfc_is_intrinsic.
* resolve.c (resolve_actual_arglist):  Ditto.
(resolve_generic_f), (resolve_unknown_f):  Ditto.
(is_external_proc):  Ditto.
(resolve_generic_s), (resolve_unknown_s):  Ditto.
(resolve_symbol):  Ditto and ensure for symbols declared INTRINSIC that
they are really available in the selected standard setting.

2008-07-24  Daniel Kraft  <d@domob.eu>

PR fortran/33141
* gfortran.dg/intrinsic_shadow_1.f03:  New test for -Wintrinsic-shadow.
* gfortran.dg/intrinsic_shadow_2.f03:  Ditto.
* gfortran.dg/intrinsic_shadow_3.f03:  Ditto.
* gfortran.dg/intrinsic_std_1.f90:  New test for -Wintrinsics-std.
* gfortran.dg/intrinsic_std_2.f90:  Ditto.
* gfortran.dg/intrinsic_std_3.f90:  Ditto.
* gfortran.dg/intrinsic_std_4.f90:  Ditto.
* gfortran.dg/warn_std_1.f90:  Removed option -Wnonstd-intrinsics.
* gfortran.dg/warn_std_2.f90:  Replaced -Wnonstd-intrinsics by
-Wintrinsics-std and adapted expected errors/warnings.
* gfortran.dg/warn_std_3.f90:  Ditto.
* gfortran.dg/c_sizeof_2.f90:  Adapted expected error/warning message.
* gfortran.dg/gamma_2.f90:  Ditto.
* gfortran.dg/selected_char_kind_3.f90:  Ditto.
* gfortran.dg/fmt_g0_2.f08:  Call with -fall-intrinsics to allow abort.

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

15 years ago2008-07-24 Daniel Kraft <d@domob.eu>
domob [Thu, 24 Jul 2008 16:06:55 +0000 (16:06 +0000)]
2008-07-24  Daniel Kraft  <d@domob.eu>

* match.c (gfc_match):  Add assertion to catch wrong calls trying to
match upper-case characters.

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

15 years ago2008-07-24 Kai Tietz <kai.tietz@onevision.com>
ktietz [Thu, 24 Jul 2008 15:47:17 +0000 (15:47 +0000)]
2008-07-24  Kai Tietz  <kai.tietz@onevision.com>

* config/i386/i386.c (get_dllimport_decl): Treat user_label_prefix for
imp symbol extension.

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

15 years ago2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
tkoenig [Thu, 24 Jul 2008 09:26:43 +0000 (09:26 +0000)]
2008-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/29952
* gfortran.h:  Add "warn_array_temp" to gfc_option_t.
* lang.opt:  Add -Warray-temporaries.
* invoke.texi:  Document -Warray-temporaries
* trans-array.h (gfc_trans_create_temp_array):  Add argument of
type *locus.
(gfc_conv_loop_setup):  Likewise.
* trans-array.c (gfc_trans_create_temp_array):  If
-Warray-temporaries is given and locus is present, warn about
creation of array temporaries.
(gfc_trans_array_constructor_subarray):  Add locus to call
of gfc_conv_loop_setup.
(gfc_trans_array_constructor):  Add where argument.  Pass where
argument to call of gfc_trans_create_temp_array.
(gfc_add_loop_ss_code):  Add where argument.  Pass where argument
to recursive call of gfc_add_loop_ss_code and to call of
gfc_trans_array_constructor.
(gfc_conv_loop_setup):  Add where argument.  Pass where argument
to calls to gfc_add_loop_ss_code and to gfc_trans_create_temp_array.
(gfc_conv_expr_descriptor):  Pass location to call of
gfc_conv_loop_setup.
(gfc_conv_array_parameter):  If -Warray-temporaries is given,
warn about creation of temporary arrays.
* trans-expr.c (gfc_conv_subref_array_arg):  Add where argument
to call to gfc_conv_loop_setup.
(gfc_conv_function_call):  Add where argument to call to
gfc_trans_creat_temp_array.
(gfc_trans_subarray_assign):  Likewise.
(gfc_trans_assignment_1):  Add where argument to call to
gfc_conv_loop_setup.
* trans-stmt.c (gfc_conv_elemental_dependencies):  Add where
argument to call to gfc_trans_create_temp_array.
(gfc_trans_call):  Add where argument to call to gfc_conv_loop_setup.
(generate_loop_for_temp_to_lhs):  Likewise.
(generate_loop_for_rhs_to_temp):  Likewise.
(compute_inner_temp_size):  Likewise.
(gfc_trans-pointer_assign_need_temp):  Likewise.
(gfc_evaluate_where_mask):  Likewise.
(gfc_trans_where_assign):  Likewise.
(gfc_trans_where_3):  Likewise.
* trans-io.c (transfer_srray_component):  Add where argument
to function. Add where argument to call to gfc_conv_loop_setup.
(transfer_expr):  Add where argument to call to
transfer_array_component.
(gfc_trans_transfer):  Add where expression to call to
gfc_conv_loop_setup.
* trans-intrinsic.c (gfc_conv_intrinsic_anyall):  Add
where argument to call to gfc_conv_loop_setup.
(gfc_conv_intrinsic_count):  Likewise.
(gfc_conv_intrinsic_arith):  Likewise.
(gfc_conv_intrinsic_dot_product):  Likewise.
(gfc_conv_intrinsic_minmaxloc):  Likewise.
(gfc_conv_intrinsic_minmaxval):  Likewise.
(gfc_conv_intrinsic_array_transfer):  Warn about
creation of temporary array.
Add where argument to call to gfc_trans_create_temp_array.
* options.c (gfc_init_options):  Initialize gfc_option.warn_array_temp.
(gfc_handle_option):  Set gfc_option.warn_array_temp.

2008-07-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/29952
* gfortran.dg/array_temporaries_1.f90: New test case.

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

15 years agolibiberty/
rwild [Thu, 24 Jul 2008 06:35:21 +0000 (06:35 +0000)]
libiberty/

* maint-tool (deps): Output config.h instead of stamp-h.
* Makefile.in: Rebuild deps.
(maintainer-clean-subdir): Depend on stamp-h rather than config.h.
Reverts 2007-07-11 change.

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

15 years ago./:
ian [Thu, 24 Jul 2008 04:51:12 +0000 (04:51 +0000)]
./:
* tree-vrp.c (infer_value_range): Ignore asm statements when
looking for memory accesses for -fdelete-null-pointer-checks.
testsuite/:
* gcc.target/i386/20080723-1.c: New test.

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

15 years agogcc/
bje [Thu, 24 Jul 2008 03:59:55 +0000 (03:59 +0000)]
gcc/
* config/spu/spu-c.c (__vector_keyword): New variable.
(vector_keyword): Likewise.
(spu_categorize_keyword): New function.
(spu_macro_to_expand): Likewise.
(spu_cpu_cpp_builtins): Enable context-sensitive macros if not
compiling an ISO C dialect.

gcc/testsuite/
* gcc.target/spu/vector.c: New test.
* gcc.target/spu/vector-ansi.c: Likewise.

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

15 years ago * config/rs6000/rs6000-c.c: Move GTY(()) markers to match
bje [Thu, 24 Jul 2008 03:35:02 +0000 (03:35 +0000)]
* config/rs6000/rs6000-c.c: Move GTY(()) markers to match
conventional usage.

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

15 years agoDaily bump.
gccadmin [Thu, 24 Jul 2008 00:16:34 +0000 (00:16 +0000)]
Daily bump.

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

15 years ago2008-07-23 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
aaronwl [Wed, 23 Jul 2008 22:50:42 +0000 (22:50 +0000)]
2008-07-23  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

* configure: Regenerate.
* configure.ac: Require texinfo 4.7.
* doc/install.texi: Document texinfo 4.7 requirement.

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

15 years ago2008-07-23 Chris Fairles <chris.fairles@gmail.com>
paolo [Wed, 23 Jul 2008 22:17:31 +0000 (22:17 +0000)]
2008-07-23  Chris Fairles <chris.fairles@gmail.com>

        * include/std/condition_variable: Update to N2691 WD.
        * include/std/mutex: Likewise.
        * testsuite/30_threads/mutex/cons/assign_neg.cc: Adjust line numbers.
        * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise.
        * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise.
        * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise.

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

15 years ago2008-07-23 Martin Jambor <mjambor@suse.cz>
jamborm [Wed, 23 Jul 2008 19:45:45 +0000 (19:45 +0000)]
2008-07-23  Martin Jambor  <mjambor@suse.cz>

        * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
rather than for DECL_SAVED_TREE.
* ipa-prop.c: Include diagnostic.h.
        (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
thoroughly.
(ipa_detect_param_modifications): Function rewritten from scratch.
(ipa_compute_jump_functions): Changed accesses to modification flags.
(ipa_free_node_params_substructures): Update flags destruction.
(ipa_node_duplication_hook): Update flags duplication.
(ipa_print_all_params_modified): Updated flag access.
* ipa-prop.h (struct ipa_param_flags): New structure.
        (struct ipa_node_params): New field modification_analysis_done,
        modified_flags changed into param_flags.
        (ipa_is_ith_param_modified): Changed to use new flags.
* Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies.

* ipa-prop.c (ipa_print_all_jump_functions): Moved here from
ipa-cp.c and split into two functions.
(ipa_print_node_jump_functions): New function.
(compute_scalar_jump_functions): New function.
(type_like_member_ptr_p): New function.
(compute_pass_through_member_ptrs): New function.
(fill_member_ptr_cst_jump_function): New function.
(determine_cst_member_ptr): New function.
(compute_cst_member_ptr_arguments): New function.
(ipa_compute_jump_functions): Complete rewrite.
* ipa-prop.h (enum jump_func_type): Make explicit that we depend
on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR.
(struct ipa_member_ptr_cst): New structure.
(union jump_func_value): New field member_cst.
* ipa-cp.c (ipcp_lat_is_insertable): New function.
(ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled
jump function types.
(ipcp_print_all_lattices): Slight fprintf rearrangement.
(ipcp_print_all_structures): Call ipa_print_all_jump_functions
instead of ipcp_print_all_jump_functions.
(ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps
only for replacable scalars.

* doc/invoke.texi (Optimize options): Add description of
-findirect-inlining.
* common.opt (flag_indirect_inlining): New flag.
* opts.c (decode_options): Set flag_indirect_inlining when
optimize >= 3.

* ipa-inline.c: Include ipa-prop.h.
(inline_indirect_intraprocedural_analysis): New function.
(inline_generate_summary): Allocate parameter and argument info
structures, call inline_indirect_intraprocedural_analysis on each
node when doing indirect inlining and deallocate indirect inlining
data structures in the end.
* ipa-prop.c (ipa_create_param_decls_array): Return if already done.
(free_all_ipa_structures_after_iinln): New function.
(free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
done.
* Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies.

* cgraphbuild.c (compute_call_stmt_bb_frequency): New function.
(build_cgraph_edges): Call compute_call_stmt_bb_frequency instead
of computing the frequency separately.
(rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead
of computing the frequency separately.
* ipa-cp.c (ipcp_print_all_structures): Replace a call to
ipa_print_all_param_modified with a call to ipa_print_all_param_flags.
* ipa-prop.c (ipa_get_member_ptr_load_param): New function.
(ipa_get_stmt_member_ptr_load_param): New function.
(ipa_is_ssa_with_stmt_def): New function.
(ipa_note_param_call): New function.
(ipa_analyze_call_uses): New function.
(ipa_analyze_stmt_uses): New function.
(ipa_analyze_params_uses): New function.
(ipa_free_node_params_substructures): Also free the param_calls linked
list.
(ipa_node_duplication_hook): Also duplicate the param_calls linked list.
(ipa_print_node_param_flags): New function.
(ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags.
(ipa_print_all_param_flags): Calls ipa_print_node_param_flags.
* ipa-prop.h (struct ipa_param_flags): New field called.
(struct ipa_param_call_note): New structure.
(struct ipa_node_params): New fields param_calls and
uses_analysis_done.
(ipa_is_ith_param_called): New function.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_analyze_params_uses and dump parameter flags.

* ipa-inline.c (cgraph_decide_recursive_inlining): Call
ipa_propagate_indirect_call_infos if performing indirect inlining,
pass a new parameter new_edges to it.
(add_new_edges_to_heap): New fucntion.
(cgraph_decide_inlining_of_small_functions): New vector
new_indirect_edges for newly found indirect edges , call
ipa_propagate_indirect_call_infos after inlining.
(cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after
inlining if performing indirect inlining.  Call
free_all_ipa_structures_after_iinln when doing so too.
(inline_generate_summary): Do not call
free_all_ipa_structures_after_iinln here.
* ipa-prop.c (update_jump_functions_after_inlining): New function.
(print_edge_addition_message): New function.
(update_call_notes_after_inlining): New function.
(propagate_info_to_inlined_callees): New function.
(ipa_propagate_indirect_call_infos): New function.
* ipa-prop.h: Include cgraph.h
(struct ipa_param_call_note): Fields reordered, new field processed.
* cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new
flag indirect_call.
* cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have
rediscovered call statements.
* cgraph.c (cgraph_create_edge): Initialize indirect_call to zero.
(dump_cgraph_node): Dump also the indirect_call flag.
(cgraph_clone_edge): Copy also the indirect_call flag.
* tree-inline.c (copy_bb): Do not check for fndecls from call
expressions, check for edge availability when moving clones.
(get_indirect_callee_fndecl): New function.
(expand_call_inline): If callee declaration is not apprent from
the statement, try calling get_indirect_callee_fndecl.  Do not
issue warnings or call sorry when not inlinings an indirect edge.
* Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies.

* ipa-prop.c (ipa_print_node_param_flags): Make the dump format a
bit more frandly to matching.
* testsuite/g++.dg/ipa/iinline-1.C: New testcase.
* testsuite/gcc.dg/ipa/iinline-1.c: New testcase.
* testsuite/gcc.dg/ipa/modif-1.c: New testcase.

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

15 years agoFix PR 36907, breakage in building libobj with function specific changes
meissner [Wed, 23 Jul 2008 19:03:40 +0000 (19:03 +0000)]
Fix PR 36907, breakage in building libobj with function specific changes

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

15 years ago2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
manu [Wed, 23 Jul 2008 15:57:49 +0000 (15:57 +0000)]
2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR 35058
* diagnostic.c (pedwarn): Add opt parameter.
(pedwarn0): New.
* c-tree.h (pedwarn_init): Add opt parameter.
(pedwarn_c90): Likewise.
(pedwarn_c99): Likewise.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.
* toplev.h (pedwarn): Update declaration.
(pedwarn0): Declare.
* c-lex.c: All calls to pedwarn changed.
* builtins.c: All calls to pedwarn changed.
* toplev.c: All calls to pedwarn changed.
* c-decl.c: All calls to pedwarn changed.
* c-typeck.c: All calls to pedwarn changed.
* c-common.c: All calls to pedwarn changed.
* c-parser.c: All calls to pedwarn changed.
cp/
* typeck.c: All calls to pedwarn changed.
* decl.c: All calls to pedwarn changed.
* call.c: All calls to pedwarn changed.
* error.c: All calls to pedwarn changed.
* typeck2.c: All calls to pedwarn changed.
* pt.c: All calls to pedwarn changed.
* name-lookup.c: All calls to pedwarn changed.
* parser.c: All calls to pedwarn changed.
fortran/
* f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
testsuite/
* gcc.dg/Wdeclaration-after-statement-3.c: New.
* gcc/testsuite/gcc.dg/Wpointer-arith.c: New.

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

15 years ago2008-07-23 Chris Fairles <chris.fairles@gmail.com>
paolo [Wed, 23 Jul 2008 14:49:00 +0000 (14:49 +0000)]
2008-07-23  Chris Fairles <chris.fairles@gmail.com>

        * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
Holds the lib that defines clock_gettime (-lrt or -lposix4).
        * src/Makefile.am: Use it.
        * configure: Regenerate.
        * configure.in: Likewise.
        * Makefile.in: Likewise.
        * src/Makefile.in: Likewise.
        * libsup++/Makefile.in: Likewise.
        * po/Makefile.in: Likewise.
        * doc/Makefile.in: Likewise.

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