This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove -fargument-[no]alias{,-global,-anything}


The flag isn't honored by most of the middle-end anymore and a
global flag for this kind of stuff is usually wrong.  Like
for Fortran pointers which can alias other pointers or things
with the target attribute.

Thus, removed.  Bootstrap is in stage3, checking pending on
x86_64-unknown-linux-gnu.

Are the Fortran parts ok for trunk?

Thanks,
Richard.

2010-04-07  Richard Guenther  <rguenther@suse.de>

	* doc/invoke.texi (-fargument-alias, -fargument-noalias,
	-fargument-noalias-global, -fargument-noalias-anything): Remove.
	* common.opt: Likewise.
	* tree-ssa-structalias.c (intra_create_variable_infos): Adjust
	comment.
	* alias.c (base_alias_check): Remove flag_argument_noalias
	handling.
	(nonoverlapping_memrefs_p): Likewise.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* opts.c (common_handle_option): Handle OPT_fargument_alias,
	OPT_fargument_noalias, OPT_fargument_noalias_anything and
	OPT_fargument_noalias_global for backward compatibility.

	fortran/
	* options.c (gfc_init_options): Do not set.

Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi	(revision 158054)
--- gcc/doc/invoke.texi	(working copy)
*************** See S/390 and zSeries Options.
*** 916,923 ****
  -fshort-double  -fshort-wchar @gol
  -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
  -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
! -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
! -fargument-noalias-global  -fargument-noalias-anything @gol
  -fleading-underscore  -ftls-model=@var{model} @gol
  -ftrapv  -fwrapv  -fbounds-check @gol
  -fvisibility}
--- 916,922 ----
  -fshort-double  -fshort-wchar @gol
  -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
  -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
! -fno-stack-limit @gol
  -fleading-underscore  -ftls-model=@var{model} @gol
  -ftrapv  -fwrapv  -fbounds-check @gol
  -fvisibility}
*************** and grows downwards, you can use the fla
*** 17444,17474 ****
  @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
  of 128KB@.  Note that this may only work with the GNU linker.
  
- @cindex aliasing of parameters
- @cindex parameters, aliased
- @item -fargument-alias
- @itemx -fargument-noalias
- @itemx -fargument-noalias-global
- @itemx -fargument-noalias-anything
- @opindex fargument-alias
- @opindex fargument-noalias
- @opindex fargument-noalias-global
- @opindex fargument-noalias-anything
- Specify the possible relationships among parameters and between
- parameters and global data.
- 
- @option{-fargument-alias} specifies that arguments (parameters) may
- alias each other and may alias global storage.@*
- @option{-fargument-noalias} specifies that arguments do not alias
- each other, but may alias global storage.@*
- @option{-fargument-noalias-global} specifies that arguments do not
- alias each other and do not alias global storage.
- @option{-fargument-noalias-anything} specifies that arguments do not
- alias any other storage.
- 
- Each language will automatically use whatever option is required by
- the language standard.  You should not need to use these options yourself.
- 
  @item -fleading-underscore
  @opindex fleading-underscore
  This option and its counterpart, @option{-fno-leading-underscore}, forcibly
--- 17443,17448 ----
Index: gcc/common.opt
===================================================================
*** gcc/common.opt	(revision 158054)
--- gcc/common.opt	(working copy)
*************** Align the start of loops
*** 307,335 ****
  falign-loops=
  Common RejectNegative Joined UInteger
  
- ; This flag is only tested if alias checking is enabled.
- ; 0 if pointer arguments may alias each other.  True in C.
- ; 1 if pointer arguments may not alias each other but may alias
- ;   global variables.
- ; 2 if pointer arguments may not alias each other and may not
- ;   alias global variables.
- ; 3 if pointer arguments may not alias anything.  True in Fortran.
- ;   Set by the front end.
  fargument-alias
! Common Report Var(flag_argument_noalias,0) Optimization
! Specify that arguments may alias each other and globals
  
  fargument-noalias
! Common Report Var(flag_argument_noalias,1) VarExists Optimization
! Assume arguments may alias globals but not each other
  
  fargument-noalias-global
! Common Report Var(flag_argument_noalias,2) VarExists Optimization
! Assume arguments alias neither each other nor globals
  
  fargument-noalias-anything
! Common Report Var(flag_argument_noalias,3) VarExists Optimization
! Assume arguments alias no other storage
  
  fasynchronous-unwind-tables
  Common Report Var(flag_asynchronous_unwind_tables) Optimization
--- 307,327 ----
  falign-loops=
  Common RejectNegative Joined UInteger
  
  fargument-alias
! Common
! Does nothing. Preserved for backward compatibility.
  
  fargument-noalias
! Common
! Does nothing. Preserved for backward compatibility.
  
  fargument-noalias-global
! Common
! Does nothing. Preserved for backward compatibility.
  
  fargument-noalias-anything
! Common
! Does nothing. Preserved for backward compatibility.
  
  fasynchronous-unwind-tables
  Common Report Var(flag_asynchronous_unwind_tables) Optimization
Index: gcc/tree-ssa-structalias.c
===================================================================
*** gcc/tree-ssa-structalias.c	(revision 158054)
--- gcc/tree-ssa-structalias.c	(working copy)
*************** intra_create_variable_infos (void)
*** 4611,4617 ****
    tree t;
  
    /* For each incoming pointer argument arg, create the constraint ARG
!      = NONLOCAL or a dummy variable if flag_argument_noalias is set.  */
    for (t = DECL_ARGUMENTS (current_function_decl); t; t = TREE_CHAIN (t))
      {
        varinfo_t p;
--- 4611,4618 ----
    tree t;
  
    /* For each incoming pointer argument arg, create the constraint ARG
!      = NONLOCAL or a dummy variable if it is a restrict qualified
!      passed-by-reference argument.  */
    for (t = DECL_ARGUMENTS (current_function_decl); t; t = TREE_CHAIN (t))
      {
        varinfo_t p;
Index: gcc/alias.c
===================================================================
*** gcc/alias.c	(revision 158054)
--- gcc/alias.c	(working copy)
*************** base_alias_check (rtx x, rtx y, enum mac
*** 1691,1704 ****
        || (GET_CODE (y_base) == ADDRESS && GET_MODE (y_base) == Pmode))
      return 0;
  
!   if (! flag_argument_noalias)
!     return 1;
! 
!   if (flag_argument_noalias > 1)
!     return 0;
! 
!   /* Weak noalias assertion (arguments are distinct, but may match globals).  */
!   return ! (GET_MODE (x_base) == VOIDmode && GET_MODE (y_base) == VOIDmode);
  }
  
  /* Convert the address X into something we can use.  This is done by returning
--- 1691,1697 ----
        || (GET_CODE (y_base) == ADDRESS && GET_MODE (y_base) == Pmode))
      return 0;
  
!   return 1;
  }
  
  /* Convert the address X into something we can use.  This is done by returning
*************** nonoverlapping_memrefs_p (const_rtx x, c
*** 2189,2201 ****
  	exprx = t;
        }
      }
-   else if (INDIRECT_REF_P (exprx))
-     {
-       exprx = TREE_OPERAND (exprx, 0);
-       if (flag_argument_noalias < 2
- 	  || TREE_CODE (exprx) != PARM_DECL)
- 	return 0;
-     }
  
    moffsety = MEM_OFFSET (y);
    if (TREE_CODE (expry) == COMPONENT_REF)
--- 2182,2187 ----
*************** nonoverlapping_memrefs_p (const_rtx x, c
*** 2217,2229 ****
  	expry = t;
        }
      }
-   else if (INDIRECT_REF_P (expry))
-     {
-       expry = TREE_OPERAND (expry, 0);
-       if (flag_argument_noalias < 2
- 	  || TREE_CODE (expry) != PARM_DECL)
- 	return 0;
-     }
  
    if (! DECL_P (exprx) || ! DECL_P (expry))
      return 0;
--- 2203,2208 ----
Index: gcc/emit-rtl.c
===================================================================
*** gcc/emit-rtl.c	(revision 158054)
--- gcc/emit-rtl.c	(working copy)
*************** set_mem_attributes_minus_bitpos (rtx ref
*** 1751,1764 ****
  		 the size we got from the type?  */
  	    }
  
- 	  else if (flag_argument_noalias > 1
- 		   && (INDIRECT_REF_P (t2))
- 		   && TREE_CODE (TREE_OPERAND (t2, 0)) == PARM_DECL)
- 	    {
- 	      expr = t2;
- 	      offset = NULL;
- 	    }
- 
  	  /* If this is an indirect reference, record it.  */
  	  else if (TREE_CODE (t) == INDIRECT_REF
  		   || TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
--- 1751,1756 ----
*************** set_mem_attributes_minus_bitpos (rtx ref
*** 1769,1784 ****
  	    }
  	}
  
-       /* If this is a Fortran indirect argument reference, record the
- 	 parameter decl.  */
-       else if (flag_argument_noalias > 1
- 	       && (INDIRECT_REF_P (t))
- 	       && TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL)
- 	{
- 	  expr = t;
- 	  offset = NULL;
- 	}
- 
        /* If this is an indirect reference, record it.  */
        else if (TREE_CODE (t) == INDIRECT_REF
  	       || TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
--- 1761,1766 ----
Index: gcc/fortran/options.c
===================================================================
*** gcc/fortran/options.c	(revision 158054)
--- gcc/fortran/options.c	(working copy)
*************** gfc_init_options (unsigned int argc, con
*** 132,140 ****
    gfc_option.rtcheck = 0;
    gfc_option.coarray = GFC_FCOARRAY_NONE;
  
-   /* Argument pointers cannot point to anything but their argument.  */
-   flag_argument_noalias = 3;
- 
    flag_errno_math = 0;
  
    set_default_std_flags ();
--- 132,137 ----
Index: gcc/opts.c
===================================================================
*** gcc/opts.c	(revision 158054)
--- gcc/opts.c	(working copy)
*************** common_handle_option (size_t scode, cons
*** 2127,2132 ****
--- 2127,2136 ----
      case OPT_ftree_salias:
      case OPT_ftree_store_ccp:
      case OPT_Wunreachable_code:
+     case OPT_fargument_alias:
+     case OPT_fargument_noalias:
+     case OPT_fargument_noalias_anything:
+     case OPT_fargument_noalias_global:
        /* These are no-ops, preserved for backward compatibility.  */
        break;
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]