This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 2.95.4 release?
On Wednesday 05 September 2001 13:14, Bernd Schmidt wrote:
> I'd like to determine whether we should have a 2.95.4 release. Could those
> who
>
> a) would like to see one
> b) would be willing to test prereleases
>
> please speak up? I'm especially looking for testers with sparc systems;
> I'd like to see a few larger packages built and tested on those systems
> with the current branch sources.
If you do a new release, it should contain this patch backport from 3.0 that
prevents miscompilation of glibc on some platforms in presence of weak symbol
references. The other glibc supporting patch is Jakub's __dso_handle patch
which works fine on PPC too.
Franz.
* rtl.h (SYMBOL_REF_WEAK): New macro.
* rtlanal.h (rtx_addr_can_trap): Use it, a weak SYMBOL_REF can trap.
* varasm.c (make_decl_rtl): Mark SYMBOL_REF weak if necessary.
* rtl.texi (SYMBOL_REF_WEAK): Document it.
* gcc.texi: Remove wrong description.
Index: gcc/gcc.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gcc.texi,v
retrieving revision 1.22.4.11
diff -u -p -r1.22.4.11 gcc.texi
--- gcc/gcc.texi 2001/01/25 14:03:16 1.22.4.11
+++ gcc/gcc.texi 2001/09/09 21:56:16
@@ -1936,13 +1936,6 @@ clutter the program with a cast to @code
useful.
@item
-Assuming (for optimization) that the address of an external symbol is
-never zero.
-
-This assumption is false on certain systems when @samp{#pragma weak} is
-used.
-
-@item
Making @samp{-fshort-enums} the default.
This would cause storage layout to be incompatible with most other C
Index: gcc/rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.105.4.4
diff -u -p -r1.105.4.4 rtl.h
--- gcc/rtl.h 2001/04/06 11:37:50 1.105.4.4
+++ gcc/rtl.h 2001/09/09 21:56:18
@@ -162,7 +162,8 @@ typedef struct rtx_def
unsigned int used : 1;
/* Nonzero if this rtx came from procedure integration.
In a REG, nonzero means this reg refers to the return value
- of the current function. */
+ of the current function.
+ 1 in a SYMBOL_REF if the symbol is weak. */
unsigned integrated : 1;
/* 1 in an INSN or a SET if this rtx is related to the call frame,
either changing how we compute the frame address or saving and
@@ -660,6 +661,9 @@ extern char *note_insn_name[];
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
#define SYMBOL_REF_USED(RTX) ((RTX)->used)
+
+/* 1 means a SYMBOL_REF is weak. */
+#define SYMBOL_REF_WEAK(RTX) ((RTX)->integrated)
/* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn
of the function that is not involved in copying parameters to
Index: gcc/rtl.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/rtl.texi,v
retrieving revision 1.20
diff -u -p -r1.20 rtl.texi
--- gcc/rtl.texi 1999/04/26 06:48:57 1.20
+++ gcc/rtl.texi 2001/09/09 21:56:21
@@ -471,6 +471,13 @@ once. Stored in the @code{used} field.
In a @code{symbol_ref}, this is used as a flag for machine-specific purposes.
Stored in the @code{volatil} field and printed as @samp{/v}.
+@findex SYMBOL_REF_WEAK
+@cindex @code{symbol_ref} and @samp{/i}
+@cindex @code{integrated}, in @code{symbol_ref}
+@item SYMBOL_REF_WEAK (@var{x})
+In a @code{symbol_ref}, indicates that @var{x} has been declared weak.
+Stored in the @code{integrated} field and printed as @samp{/i}.
+
@findex LABEL_OUTSIDE_LOOP_P
@cindex @code{label_ref} and @samp{/s}
@cindex @code{in_struct}, in @code{label_ref}
Index: gcc/rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.36.4.2
diff -u -p -r1.36.4.2 rtlanal.c
--- gcc/rtlanal.c 2001/01/25 14:03:22 1.36.4.2
+++ gcc/rtlanal.c 2001/09/09 21:56:22
@@ -136,11 +136,9 @@ rtx_addr_can_trap_p (x)
switch (code)
{
case SYMBOL_REF:
+ return SYMBOL_REF_WEAK (x);
+
case LABEL_REF:
- /* SYMBOL_REF is problematic due to the possible presence of
- a #pragma weak, but to say that loads from symbols can trap is
- *very* costly. It's not at all clear what's best here. For
- now, we ignore the impact of #pragma weak. */
return 0;
case REG:
Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.59.4.8
diff -u -p -r1.59.4.8 varasm.c
--- gcc/varasm.c 2001/03/28 09:02:17 1.59.4.8
+++ gcc/varasm.c 2001/09/09 21:56:26
@@ -755,6 +755,7 @@ make_decl_rtl (decl, asmspec, top_level)
DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
gen_rtx_SYMBOL_REF (Pmode, name));
MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl);
+ SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = DECL_WEAK (decl);
/* If this variable is to be treated as volatile, show its
tree node has side effects. If it has side effects, either