rpms/compat-gcc-32/devel gcc32-CVE-2006-3619.patch, NONE, 1.1 gcc32-java-zoneinfo.patch, NONE, 1.1 gcc32-libgcc_eh-hidden.patch, NONE, 1.1 gcc32-pr26208-workaround.patch, NONE, 1.1 gcc32-pr26208.patch, NONE, 1.1 gcc32-rh173224.patch, NONE, 1.1 gcc32-rh180778.patch, NONE, 1.1 gcc32-rh181894.patch, NONE, 1.1 gcc32-rh186252.patch, NONE, 1.1 gcc32-rh226706.patch, NONE, 1.1 compat-gcc-32.spec, 1.29, 1.30
Jakub Jelinek (jakub)
fedora-extras-commits at redhat.com
Tue Oct 9 18:53:29 UTC 2007
Author: jakub
Update of /cvs/pkgs/rpms/compat-gcc-32/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28263
Modified Files:
compat-gcc-32.spec
Added Files:
gcc32-CVE-2006-3619.patch gcc32-java-zoneinfo.patch
gcc32-libgcc_eh-hidden.patch gcc32-pr26208-workaround.patch
gcc32-pr26208.patch gcc32-rh173224.patch gcc32-rh180778.patch
gcc32-rh181894.patch gcc32-rh186252.patch gcc32-rh226706.patch
Log Message:
3.2.3-62
gcc32-CVE-2006-3619.patch:
--- NEW FILE gcc32-CVE-2006-3619.patch ---
2006-07-17 Richard Guenther <rguenther at suse.de>
* jartool.c (extract_jar): Do not allow directory traversal
to parents of the extraction root.
--- fastjar/jartool.c.jj 2006-07-11 10:53:39.000000000 +0200
+++ fastjar/jartool.c 2006-07-18 13:49:39.000000000 +0200
@@ -1736,6 +1736,7 @@ int extract_jar(int fd, char **files, in
const ub1 *start = filename;
char *tmp_buff;
struct stat sbuf;
+ int depth = 0;
tmp_buff = malloc(sizeof(char) * strlen((const char *)filename));
@@ -1756,7 +1757,14 @@ int extract_jar(int fd, char **files, in
#ifdef DEBUG
printf("checking the existance of %s\n", tmp_buff);
#endif
-
+ if(strcmp(tmp_buff, "..") == 0){
+ --depth;
+ if (depth < 0){
+ fprintf(stderr, "Traversal to parent directories during unpacking!\n");
+ exit(1);
+ }
+ } else if (strcmp(tmp_buff, ".") != 0)
+ ++depth;
if(stat(tmp_buff, &sbuf) < 0){
if(errno != ENOENT){
perror("stat");
gcc32-java-zoneinfo.patch:
--- NEW FILE gcc32-java-zoneinfo.patch ---
2007-02-24 Jakub Jelinek <jakub at redhat.com>
* java/util/TimeZone.java (getDefaultDisplayName): Don't
check if TimeZone is instanceof SimpleTimeZone.
2007-02-23 Jakub Jelinek <jakub at redhat.com>
PR libgcj/17002
PR classpath/28550
* java/lang/System.java: Add gnu.java.util.zoneinfo.dir to comments.
* posix.cc (_Jv_platform_initProperties): Set
gnu.java.util.zoneinfo.dir.
* Makefile.am (ordinary_java_source_files): Add
gnu/java/util/ZoneInfo.java.
* Makefile.in: Regenerated.
* java/util/Date.java (parse): Properly parse 09:01:02 as
hours/minutes/seconds, not as hours/minutes/year.
* java/util/SimpleTimeZone.java (getOffset): Handle properly
millis + dstOffset overflowing into the next day.
* java/util/TimeZone.java (zoneinfo_dir, availableIDs, aliases0): New
static fields.
(timezones): Remove synchronized keyword. Set zoneinfo_dir.
If non-null, set up aliases0 and don't put anything into
timezones0.
(defaultZone): Call getTZEnvVar to try TZ env var.
Try to read /etc/localtime using ZoneInfo.readTZFile.
Call getDefaultTimeZone instead of getTimeZone.
(getDefaultTimeZone, getDateParams, parseTime): New private methods.
(getTimeZoneInternal): New private method.
(getTimeZone): Do the custom ID checking first, canonicalize
ID for custom IDs as required by documentation. Call
getTimeZoneInternal to handle the rest.
(getAvailableIDs(int)): Add locking. Handle zoneinfo_dir != null.
(getAvailableIDs(File,String,ArrayList)): New private method.
(getAvailableIDs()): Add locking. Handle zoneinfo_dir != null.
(readSysconfigClockFile): New static method.
(getTZEnvVar): New native method.
* java/util/natSystem.cc: Include java/lang/Character.h and
java/lang/Integer.h.
(java::lang::System::getSystemTimeZone): Renamed to...
(getSystemTimeZone): ... this. Add static.
(java::lang::System::init_properties): Don't set user.timezone
property.
(java::util::TimeZone::getDefaultTimeZoneId): New.
(java::util::TimeZone::getTZEnvVar): New method.
* gnu/java/util/ZoneInfo.java: New file.
* java/util/GregorianCalendar.java
(GregorianCalendar): Call clear before set in the constructors that
don't initialize it to current time.
2007-02-09 Jakub Jelinek <jakub at redhat.com>
PR 23566
* java/util/TimeZone.java (timezones): Regenerate from tzdata2007a.
2005-02-21 Jeroen Frijters <jeroen at frijters.net>
* java/util/GregorianCalendar.java
(GregorianCalendar): Chained constructors to a (new)
common constructor.
2004-01-03 Per Bothner <per at bothner.com>
* java/util/Date.java (parse): Fix a number of problems.
(skipParens): Remove no-longer-needed method.
2003-11-27 Ito Kazumitsu <kaz at maczuka.gcd.org>
* java/util/GregorianCalendar.java (getLinearTime): Avoid counting
the leap day of the leap year twice.
2003-09-18 Ingo Proetel <proetel at aicas.com>
* java/util/TimeZone.java: Initialize lazily.
2002-05-13 Tom Tromey <tromey at redhat.com>
* java/util/TimeZone.java (getDefaultTimeZoneId): New method.
--- libjava/Makefile.am.jj 2007-02-23 21:17:39.000000000 +0100
+++ libjava/Makefile.am 2007-02-23 21:28:22.000000000 +0100
@@ -1431,6 +1431,7 @@ gnu/java/text/LineBreakIterator.java \
gnu/java/text/SentenceBreakIterator.java \
gnu/java/text/WordBreakIterator.java \
gnu/java/util/DoubleEnumeration.java \
+gnu/java/util/ZoneInfo.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
--- libjava/Makefile.in.jj 2007-02-23 21:17:39.000000000 +0100
+++ libjava/Makefile.in 2007-02-23 21:28:55.000000000 +0100
@@ -1183,6 +1183,7 @@ gnu/java/text/LineBreakIterator.java \
gnu/java/text/SentenceBreakIterator.java \
gnu/java/text/WordBreakIterator.java \
gnu/java/util/DoubleEnumeration.java \
+gnu/java/util/ZoneInfo.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
@@ -2017,7 +2018,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_D
.deps/gnu/java/text/LineBreakIterator.P \
.deps/gnu/java/text/SentenceBreakIterator.P \
.deps/gnu/java/text/WordBreakIterator.P \
-.deps/gnu/java/util/DoubleEnumeration.P .deps/interpret.P \
+.deps/gnu/java/util/DoubleEnumeration.P \
+.deps/gnu/java/util/ZoneInfo.P .deps/interpret.P \
.deps/java/applet/Applet.P .deps/java/applet/AppletContext.P \
.deps/java/applet/AppletStub.P .deps/java/applet/AudioClip.P \
.deps/java/awt/AWTError.P .deps/java/awt/AWTEvent.P \
--- libjava/java/util/GregorianCalendar.java.jj 2007-02-23 21:17:36.000000000 +0100
+++ libjava/java/util/GregorianCalendar.java 2007-02-26 09:54:12.000000000 +0100
@@ -111,6 +111,13 @@ public class GregorianCalendar extends C
this(TimeZone.getDefault(), locale);
}
+ private GregorianCalendar(TimeZone zone, Locale locale, boolean unused)
+ {
+ super(zone, locale);
+ ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
+ gregorianCutover = ((Date) rb.getObject("gregorianCutOver")).getTime();
+ }
+
/**
* Constructs a new GregorianCalender representing the current
* time with the given time zone and the given locale.
@@ -119,9 +126,7 @@ public class GregorianCalendar extends C
*/
public GregorianCalendar(TimeZone zone, Locale locale)
{
- super(zone, locale);
- ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
- gregorianCutover = ((Date) rb.getObject("gregorianCutOver")).getTime();
+ this(zone, locale, false);
setTimeInMillis(System.currentTimeMillis());
}
@@ -134,7 +139,8 @@ public class GregorianCalendar extends C
*/
public GregorianCalendar(int year, int month, int day)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
+ clear();
set(year, month, day);
}
@@ -149,7 +155,8 @@ public class GregorianCalendar extends C
*/
public GregorianCalendar(int year, int month, int day, int hour, int minute)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
+ clear();
set(year, month, day, hour, minute);
}
@@ -166,7 +173,8 @@ public class GregorianCalendar extends C
public GregorianCalendar(int year, int month, int day,
int hour, int minute, int second)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
+ clear();
set(year, month, day, hour, minute, second);
}
@@ -254,8 +262,10 @@ public class GregorianCalendar extends C
//
// The additional leap year factor accounts for the fact that
// a leap day is not seen on Jan 1 of the leap year.
+ // And on and after the leap day, the leap day has already been
+ // included in dayOfYear.
int gregOffset = (year / 400) - (year / 100) + 2;
- if (isLeapYear (year, true) && dayOfYear < 31 + 29)
+ if (isLeapYear (year, true))
--gregOffset;
time += gregOffset * (24 * 60 * 60 * 1000L);
}
--- libjava/java/util/SimpleTimeZone.java.jj 2007-02-23 21:17:36.000000000 +0100
+++ libjava/java/util/SimpleTimeZone.java 2007-02-23 21:27:21.000000000 +0100
@@ -458,16 +458,34 @@ public class SimpleTimeZone extends Time
int daylightSavings = 0;
if (useDaylight && era == GregorianCalendar.AD && year >= startYear)
{
+ int orig_year = year;
// This does only work for Gregorian calendars :-(
// This is mainly because setStartYear doesn't take an era.
boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis,
startMode, startMonth,
startDay, startDayOfWeek, startTime);
+ millis += dstSavings;
+ if (millis >= 24 * 60 * 60 * 1000)
+ {
+ millis -= 24 * 60 * 60 * 1000;
+ dayOfWeek = (dayOfWeek % 7) + 1;
+ if (++day > getDaysInMonth(month, year))
+ {
+ day = 1;
[...3807 lines suppressed...]
+ else
+ { // convert the dst string to a millis number
+ String offset = tzstr.substring(prevIndex, index);
+ prevIndex = index;
+
+ if (offset.charAt(0) == '+' || offset.charAt(0) == '-')
+ dstOffs = parseTime(offset.substring(1));
+ else
+ dstOffs = parseTime(offset);
+
+ if (offset.charAt(0) == '-')
+ dstOffs = -dstOffs;
+
+ // TZ timezone offsets are positive when WEST of the meridian.
+ dstOffs = -dstOffs;
+ }
+
+ // Done yet? (Format: std offset dst offset)
+ if (index >= idLength)
+ return new SimpleTimeZone(stdOffs, stdName);
+
+ // get the DST rule
+ if (tzstr.charAt(index) == ','
+ || tzstr.charAt(index) == ';')
+ {
+ index++;
+ int offs = index;
+ while (tzstr.charAt(index) != ','
+ && tzstr.charAt(index) != ';')
+ index++;
+ String startTime = tzstr.substring(offs, index);
+ index++;
+ String endTime = tzstr.substring(index);
+
+ index = startTime.indexOf('/');
+ int startMillis;
+ int endMillis;
+ String startDate;
+ String endDate;
+ if (index != -1)
+ {
+ startDate = startTime.substring(0, index);
+ startMillis = parseTime(startTime.substring(index + 1));
+ }
+ else
+ {
+ startDate = startTime;
+ // if time isn't given, default to 2:00:00 AM.
+ startMillis = 2 * 60 * 60 * 1000;
+ }
+ index = endTime.indexOf('/');
+ if (index != -1)
+ {
+ endDate = endTime.substring(0, index);
+ endMillis = parseTime(endTime.substring(index + 1));
+ }
+ else
+ {
+ endDate = endTime;
+ // if time isn't given, default to 2:00:00 AM.
+ endMillis = 2 * 60 * 60 * 1000;
+ }
+
+ int[] start = getDateParams(startDate);
+ int[] end = getDateParams(endDate);
+ return new SimpleTimeZone(stdOffs, tzstr, start[0], start[1],
+ start[2], startMillis, end[0], end[1],
+ end[2], endMillis, (dstOffs - stdOffs));
+ }
+ }
+
+ catch (IndexOutOfBoundsException _)
+ {
+ }
+ catch (NumberFormatException _)
+ {
+ }
+
+ return null;
+ }
+
+ /**
+ * Parses and returns the params for a POSIX TZ date field,
+ * in the format int[]{ month, day, dayOfWeek }, following the
+ * SimpleTimeZone constructor rules.
+ */
+ private static int[] getDateParams(String date)
+ {
+ int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+ int month;
+ int type = 0;
+
+ if (date.charAt(0) == 'M' || date.charAt(0) == 'm')
+ type = 1;
+ else if (date.charAt(0) == 'A' || date.charAt(0) == 'a')
+ type = 2;
+
+ if (type > 0)
+ {
+ int day;
+
+ // Month, week of month, day of week
+ // "Mm.w.d". d is between 0 (Sunday) and 6. Week w is
+ // between 1 and 5; Week 1 is the first week in which day d
+ // occurs and Week 5 specifies the last d day in the month.
+ // Month m is between 1 and 12.
+
+ // Month, day of month, day of week
+ // ZoneInfo extension, not in POSIX
+ // "Am.n.d". d is between 0 (Sunday) and 6. Day of month n is
+ // between 1 and 25. Month m is between 1 and 12.
+
+ month = Integer.parseInt(date.substring(1, date.indexOf('.')));
+ int week = Integer.parseInt(date.substring(date.indexOf('.') + 1,
+ date.lastIndexOf('.')));
+ int dayOfWeek = Integer.parseInt(date.substring(date.lastIndexOf('.')
+ + 1));
+ dayOfWeek++; // Java day of week is one-based, Sunday is first day.
+
+ if (type == 2)
+ {
+ day = week;
+ dayOfWeek = -dayOfWeek;
+ }
+ else if (week == 5)
+ day = -1; // last day of month is -1 in java, 5 in TZ
+ else
+ {
+ // First day of week starting on or after. For example,
+ // to specify the second Sunday of April, set month to
+ // APRIL, day-of-month to 8, and day-of-week to -SUNDAY.
+ day = (week - 1) * 7 + 1;
+ dayOfWeek = -dayOfWeek;
+ }
+
+ month--; // Java month is zero-based.
+ return new int[] { month, day, dayOfWeek };
+ }
+
+ // julian day, either zero-based 0<=n<=365 (incl feb 29)
+ // or one-based 1<=n<=365 (no feb 29)
+ int julianDay; // Julian day
+
+ if (date.charAt(0) != 'J' || date.charAt(0) != 'j')
+ {
+ julianDay = Integer.parseInt(date.substring(1));
+ julianDay++; // make 1-based
+ // Adjust day count to include feb 29.
+ dayCount = new int[]
+ {
+ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335
+ };
+ }
+ else
+ // 1-based julian day
+ julianDay = Integer.parseInt(date);
+
+ int i = 11;
+ while (i > 0)
+ if (dayCount[i] < julianDay)
+ break;
+ else
+ i--;
+ julianDay -= dayCount[i];
+ month = i;
+ return new int[] { month, julianDay, 0 };
+ }
+
+ /**
+ * Parses a time field hh[:mm[:ss]], returning the result
+ * in milliseconds. No leading sign.
+ */
+ private static int parseTime(String time)
+ {
+ int millis = 0;
+ int i = 0;
+
+ while (i < time.length())
+ if (time.charAt(i) == ':')
+ break;
+ else
+ i++;
+ millis = 60 * 60 * 1000 * Integer.parseInt(time.substring(0, i));
+ if (i >= time.length())
+ return millis;
+
+ int iprev = ++i;
+ while (i < time.length())
+ if (time.charAt(i) == ':')
+ break;
+ else
+ i++;
+ millis += 60 * 1000 * Integer.parseInt(time.substring(iprev, i));
+ if (i >= time.length())
+ return millis;
+
+ millis += 1000 * Integer.parseInt(time.substring(++i));
+ return millis;
+ }
+}
gcc32-libgcc_eh-hidden.patch:
--- NEW FILE gcc32-libgcc_eh-hidden.patch ---
--- gcc/mklibgcc.in.jj 2006-05-22 14:03:31.000000000 -0400
+++ gcc/mklibgcc.in 2006-05-22 14:03:31.000000000 -0400
@@ -310,10 +310,24 @@ for ml in $MULTILIBS; do
if [ "$SHLIB_LINK" ]; then
+ if [ "@libgcc_visibility@" = yes ]; then
+ libgcc_eh_objS=
+ echo ""
+ for o in $libgcc_eh_objs; do
+ # .oS objects will have all non-local symbol definitions .hidden
+ oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
+ echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
+ echo ' @( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
+ libgcc_eh_objS="${libgcc_eh_objS} ${oS}"
+ done
+ else
+ libgcc_eh_objS="$libgcc_eh_objs"
+ fi
+
echo ""
- echo "${dir}/libgcc_eh.a: $libgcc_eh_objs"
+ echo "${dir}/libgcc_eh.a: $libgcc_eh_objS"
echo " -rm -rf ${dir}/libgcc_eh.a"
- echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
+ echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objS
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a ';' \\
echo ' else true; fi;'
gcc32-pr26208-workaround.patch:
--- NEW FILE gcc32-pr26208-workaround.patch ---
--- gcc/unwind-dw2.c.jj 2006-05-22 13:39:48.000000000 -0400
+++ gcc/unwind-dw2.c 2006-05-22 13:48:20.000000000 -0400
@@ -61,8 +61,8 @@ struct _Unwind_Context
void *ra;
void *lsda;
struct dwarf_eh_bases bases;
+#define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1)
_Unwind_Word args_size;
- char signal_frame;
};
/* Byte size of every register managed by these routines. */
@@ -201,7 +201,7 @@ _Unwind_GetIP (struct _Unwind_Context *c
inline _Unwind_Ptr
_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
{
- *ip_before_insn = context->signal_frame != 0;
+ *ip_before_insn = (context->args_size & SIGNAL_FRAME_BIT) != 0;
return (_Unwind_Ptr) context->ra;
}
@@ -758,7 +758,8 @@ execute_cfa_program (const unsigned char
reflected at the point immediately before the call insn.
In signal frames, return address is after last completed instruction,
so we add 1 to return address to make the comparison <=. */
- while (insn_ptr < insn_end && fs->pc < context->ra + context->signal_frame)
+ while (insn_ptr < insn_end
+ && fs->pc < context->ra + ((context->args_size & SIGNAL_FRAME_BIT) != 0))
{
unsigned char insn = *insn_ptr++;
_Unwind_Word reg, utmp;
@@ -918,7 +919,14 @@ execute_cfa_program (const unsigned char
break;
case DW_CFA_GNU_args_size:
- insn_ptr = read_uleb128 (insn_ptr, &context->args_size);
+ {
+ _Unwind_Word args_size;
+ insn_ptr = read_uleb128 (insn_ptr, &args_size);
+ if (args_size & SIGNAL_FRAME_BIT)
+ abort ();
+ context->args_size
+ = (context->args_size & SIGNAL_FRAME_BIT) | args_size;
+ }
break;
case DW_CFA_GNU_negative_offset_extended:
@@ -945,10 +953,10 @@ uw_frame_state_for (struct _Unwind_Conte
const unsigned char *aug, *insn, *end;
memset (fs, 0, sizeof (*fs));
- context->args_size = 0;
+ context->args_size &= SIGNAL_FRAME_BIT;
context->lsda = 0;
- fde = _Unwind_Find_FDE (context->ra + context->signal_frame - 1,
+ fde = _Unwind_Find_FDE (context->ra + ((context->args_size & SIGNAL_FRAME_BIT) != 0) - 1,
&context->bases);
if (fde == NULL)
{
@@ -1092,7 +1100,7 @@ __frame_state_for (void *pc_target, stru
state_in->cfa_offset = fs.cfa_offset;
state_in->cfa_reg = fs.cfa_reg;
state_in->retaddr_column = fs.retaddr_column;
- state_in->args_size = context.args_size;
+ state_in->args_size = context.args_size & ~SIGNAL_FRAME_BIT;
state_in->eh_ptr = fs.eh_ptr;
#ifdef __linux__
@@ -1287,7 +1295,10 @@ uw_update_context_1 (struct _Unwind_Cont
break;
}
- context->signal_frame = fs->signal_frame;
+ if (fs->signal_frame)
+ context->args_size |= SIGNAL_FRAME_BIT;
+ else
+ context->args_size &= ~SIGNAL_FRAME_BIT;
MD_FROB_UPDATE_CONTEXT (context, fs);
}
@@ -1403,9 +1414,9 @@ uw_install_context_1 (struct _Unwind_Con
/* We adjust SP by the difference between CURRENT and TARGET's CFA. */
if (STACK_GROWS_DOWNWARD)
- return target_cfa - current->cfa + target->args_size;
+ return target_cfa - current->cfa + (target->args_size & ~SIGNAL_FRAME_BIT);
else
- return current->cfa - target_cfa - target->args_size;
+ return current->cfa - target_cfa - (target->args_size & ~SIGNAL_FRAME_BIT);
}
#else
return 0;
--- libjava/exception.cc.jj 2006-05-22 13:39:48.000000000 -0400
+++ libjava/exception.cc 2006-05-22 14:48:30.000000000 -0400
@@ -31,6 +31,153 @@ namespace std
}
#include "unwind.h"
+#if defined PIC && !defined __ia64__
+
+#include <dlfcn.h>
+
+extern "C" {
+
+static void *libgcc_s_handle;
+
+_Unwind_Reason_Code __attribute__((visibility ("hidden")))
+_Unwind_RaiseException (struct _Unwind_Exception *exc)
+{
+ static _Unwind_Reason_Code (*RaiseException) (struct _Unwind_Exception *);
+
+ if (RaiseException == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ RaiseException = (__typeof (RaiseException))
+ dlsym (libgcc_s_handle, "_Unwind_RaiseException");
+ }
+ return RaiseException (exc);
+}
+
+void __attribute__((visibility ("hidden")))
+_Unwind_Resume (struct _Unwind_Exception *exc)
+{
+ static void (*Resume) (struct _Unwind_Exception *);
+
+ if (Resume == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ Resume = (__typeof (Resume))
+ dlsym (libgcc_s_handle, "_Unwind_Resume");
+ }
+ Resume (exc);
+}
+
+__attribute__((visibility ("hidden"))) void *
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *ctx)
+{
+ static void * (*GetLanguageSpecificData) (struct _Unwind_Context *);
+
+ if (GetLanguageSpecificData == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ GetLanguageSpecificData = (__typeof (GetLanguageSpecificData))
+ dlsym (libgcc_s_handle, "_Unwind_GetLanguageSpecificData");
+ }
+ return GetLanguageSpecificData (ctx);
+}
+
+_Unwind_Ptr __attribute__((visibility ("hidden")))
+_Unwind_GetRegionStart (struct _Unwind_Context *ctx)
+{
+ static _Unwind_Ptr (*GetRegionStart) (struct _Unwind_Context *);
+
+ if (GetRegionStart == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ GetRegionStart = (__typeof (GetRegionStart))
+ dlsym (libgcc_s_handle, "_Unwind_GetRegionStart");
+ }
+ return GetRegionStart (ctx);
+}
+
+_Unwind_Ptr __attribute__((visibility ("hidden")))
+_Unwind_GetDataRelBase (struct _Unwind_Context *ctx)
+{
+ static _Unwind_Ptr (*GetDataRelBase) (struct _Unwind_Context *);
+
+ if (GetDataRelBase == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ GetDataRelBase = (__typeof (GetDataRelBase))
+ dlsym (libgcc_s_handle, "_Unwind_GetDataRelBase");
+ }
+ return GetDataRelBase (ctx);
+}
+
+_Unwind_Ptr __attribute__((visibility ("hidden")))
+_Unwind_GetTextRelBase (struct _Unwind_Context *ctx)
+{
+ static _Unwind_Ptr (*GetTextRelBase) (struct _Unwind_Context *);
+
+ if (GetTextRelBase == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ GetTextRelBase = (__typeof (GetTextRelBase))
+ dlsym (libgcc_s_handle, "_Unwind_GetTextRelBase");
+ }
+ return GetTextRelBase (ctx);
+}
+
+_Unwind_Ptr __attribute__((visibility ("hidden")))
+_Unwind_GetIPInfo (struct _Unwind_Context *ctx, int *ip)
+{
+ static _Unwind_Ptr (*GetIPInfo) (struct _Unwind_Context *, int *ip);
+
+ if (GetIPInfo == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ GetIPInfo = (__typeof (GetIPInfo))
+ dlsym (libgcc_s_handle, "_Unwind_GetIPInfo");
+ }
+ return GetIPInfo (ctx, ip);
+}
+
+void __attribute__((visibility ("hidden")))
+_Unwind_SetIP (struct _Unwind_Context *ctx, _Unwind_Ptr ip)
+{
+ static void (*SetIP) (struct _Unwind_Context *, _Unwind_Ptr ip);
+
+ if (SetIP == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ SetIP = (__typeof (SetIP))
+ dlsym (libgcc_s_handle, "_Unwind_SetIP");
+ }
+ SetIP (ctx, ip);
+}
+
+void __attribute__((visibility ("hidden")))
+_Unwind_SetGR (struct _Unwind_Context *ctx, int num, _Unwind_Ptr gr)
+{
+ static void (*SetGR) (struct _Unwind_Context *, int num, _Unwind_Ptr gr);
+
+ if (SetGR == NULL)
+ {
+ if (libgcc_s_handle == NULL)
+ libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
+ SetGR = (__typeof (SetGR))
+ dlsym (libgcc_s_handle, "_Unwind_SetGR");
+ }
+ SetGR (ctx, num, gr);
+}
+
+}
+
+#endif
+
struct alignment_test_struct
{
char space;
gcc32-pr26208.patch:
--- NEW FILE gcc32-pr26208.patch ---
2006-02-27 Jakub Jelinek <jakub at redhat.com>
PR other/26208
* unwind-dw2.c (struct _Unwind_Context): Add signal_frame field.
(_Unwind_FrameState): Add signal_frame field.
(extract_cie_info): Handle S flag in augmentation string.
(execute_cfa_program): If context->signal_frame, execute also
fs->pc == context->ra instructions.
(uw_frame_state_for): If context->signal_frame, don't subtract one
from context->ra to find FDE.
(uw_update_context_1): Set context->signal_frame to
fs->signal_frame.
(_Unwind_GetIPInfo): New function.
* unwind-c.c (PERSONALITY_FUNCTION): Use _Unwind_GetIPInfo instead
of _Unwind_GetIP.
* unwind-sjlj.c (_Unwind_GetIPInfo): New function.
* unwind.h (_Unwind_GetIPInfo): New prototype.
* libgcc-std.ver (_Unwind_GetIPInfo): Export @@GCC_4.2.0.
* config/ia64/unwind-ia64.c (_Unwind_GetIPInfo): New function.
* config/i386/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Set
(FS)->signal_frame.
* config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Likewise.
* config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Likewise.
* config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Likewise.
* config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Likewise.
* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Use
_Unwind_GetIPInfo instead of _Unwind_GetIP.
* exception.cc (PERSONALITY_FUNCTION): Use _Unwind_GetIPInfo instead
of _Unwind_GetIP.
* include/i386-signal.h (MAKE_THROW_FRAME): Change into empty macro.
(HANDLE_DIVIDE_OVERFLOW): Don't adjust _res->eip if falling through
to throw.
* include/x86_64-signal.h (MAKE_THROW_FRAME): Change into empty
macro.
* include/powerpc-signal.h (MAKE_THROW_FRAME): Change into empty
macro.
--- libjava/exception.cc.jj 2002-04-09 16:20:32.000000000 +0200
+++ libjava/exception.cc 2006-04-25 15:33:37.000000000 +0200
@@ -196,6 +196,7 @@ PERSONALITY_FUNCTION (int version,
int handler_switch_value;
bool saw_cleanup;
bool saw_handler;
+ int ip_before_insn = 0;
// Interface version check.
@@ -211,10 +212,10 @@ PERSONALITY_FUNCTION (int version,
goto install_context;
}
- // FIXME: In Phase 1, record _Unwind_GetIP in xh->obj as a part of
+ // FIXME: In Phase 1, record _Unwind_GetIPInfo in xh->obj as a part of
// the stack trace for this exception. This will only collect Java
// frames, but perhaps that is acceptable.
- // FIXME2: _Unwind_GetIP is nonsensical for SJLJ, being a call-site
+ // FIXME2: _Unwind_GetIPInfo is nonsensical for SJLJ, being a call-site
// index instead of a PC value. We could perhaps arrange for
// _Unwind_GetRegionStart to return context->fc->jbuf[1], which
// is the address of the handler label for __builtin_longjmp, but
@@ -229,7 +230,9 @@ PERSONALITY_FUNCTION (int version,
// Parse the LSDA header.
p = parse_lsda_header (context, language_specific_data, &info);
- ip = _Unwind_GetIP (context) - 1;
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+ if (! ip_before_insn)
+ --ip;
landing_pad = 0;
action_record = 0;
handler_switch_value = 0;
--- libjava/include/i386-signal.h.jj 2002-03-18 23:27:01.000000000 +0100
+++ libjava/include/i386-signal.h 2006-04-25 15:33:37.000000000 +0200
@@ -22,19 +22,7 @@ details. */
#define SIGNAL_HANDLER(_name) \
static void _name (int _dummy)
-#define MAKE_THROW_FRAME(_exception) \
-do \
-{ \
- void **_p = (void **)&_dummy; \
- struct sigcontext_struct *_regs = (struct sigcontext_struct *)++_p; \
- \
- /* Advance the program counter so that it is after the start of the \
- instruction: the x86 exception handler expects \
- the PC to point to the instruction after a call. */ \
- _regs->eip += 2; \
- \
-} \
-while (0)
+#define MAKE_THROW_FRAME(_exception)
#define HANDLE_DIVIDE_OVERFLOW \
do \
@@ -84,14 +72,6 @@ do \
_regs->eip = (unsigned long)_eip; \
return; \
} \
- else \
- { \
- /* Advance the program counter so that it is after the start \
- of the instruction: this is because the x86 exception \
- handler expects the PC to point to the instruction after a \
- call. */ \
- _regs->eip += 2; \
- } \
} \
} \
while (0)
--- libjava/include/x86_64-signal.h.jj 2003-01-24 23:41:38.000000000 +0100
+++ libjava/include/x86_64-signal.h 2006-04-25 15:34:23.000000000 +0200
@@ -34,17 +34,7 @@ extern "C"
};
}
-#define MAKE_THROW_FRAME(_exception) \
-do \
-{ \
- /* Advance the program counter so that it is after the start of the \
- instruction: the x86_64 exception handler expects \
- the PC to point to the instruction after a call. */ \
- struct ucontext *_uc = (struct ucontext *)_p; \
- struct sigcontext *_sc = (struct sigcontext *) &_uc->uc_mcontext; \
- _sc->rip += 2; \
-} \
-while (0)
+#define MAKE_THROW_FRAME(_exception)
#define RESTORE(name, syscall) RESTORE2 (name, syscall)
#define RESTORE2(name, syscall) \
--- libjava/include/powerpc-signal.h.jj 2004-02-28 12:27:44.000000000 +0100
+++ libjava/include/powerpc-signal.h 2006-04-25 15:33:37.000000000 +0200
@@ -22,18 +22,12 @@ details. */
#define SIGNAL_HANDLER(_name) \
static void _name (int /* _signal */, struct sigcontext *_sc)
-/* PPC either leaves PC pointing at a faulting instruction or the
- following instruction, depending on the signal. SEGV always does
- the former, so we adjust the saved PC to point to the following
- instruction. This is what the handler in libgcc expects. */
+/* MD_FALBACK_FRAME_STATE_FOR takes care of special casing PC
+ before the faulting instruction, so we don't need to do anything
+ here. */
+
+#define MAKE_THROW_FRAME(_exception)
-#define MAKE_THROW_FRAME(_exception) \
-do \
- { \
- _sc->regs->nip += 4; \
- } \
-while (0)
-
/* For an explanation why we cannot simply use sigaction to
install the handlers, see i386-signal.h. */
--- libstdc++-v3/libsupc++/eh_personality.cc.jj 2003-06-11 15:08:13.000000000 +0200
+++ libstdc++-v3/libsupc++/eh_personality.cc 2006-04-25 15:33:37.000000000 +0200
@@ -201,6 +201,7 @@ PERSONALITY_FUNCTION (int version,
_Unwind_Ptr landing_pad, ip;
int handler_switch_value;
void *thrown_ptr = xh + 1;
+ int ip_before_insn = 0;
// Interface version check.
if (version != 1)
@@ -227,7 +228,9 @@ PERSONALITY_FUNCTION (int version,
// Parse the LSDA header.
p = parse_lsda_header (context, language_specific_data, &info);
info.ttype_base = base_of_encoded_value (info.ttype_encoding, context);
- ip = _Unwind_GetIP (context) - 1;
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+ if (! ip_before_insn)
+ --ip;
landing_pad = 0;
action_record = 0;
handler_switch_value = 0;
--- gcc/libgcc-std.ver.jj 2004-02-28 12:16:53.000000000 +0100
+++ gcc/libgcc-std.ver 2006-04-25 15:33:37.000000000 +0200
@@ -210,3 +210,8 @@ GCC_3.4 {
__paritydi2
__parityti2
}
+
+%inherit GCC_4.2.0 GCC_3.4
+GCC_4.2.0 {
+ _Unwind_GetIPInfo
+}
--- gcc/unwind-c.c.jj 2003-06-11 15:08:12.000000000 +0200
+++ gcc/unwind-c.c 2006-04-25 15:33:37.000000000 +0200
@@ -93,6 +93,7 @@ PERSONALITY_FUNCTION (int version,
lsda_header_info info;
const unsigned char *language_specific_data, *p, *action_record;
_Unwind_Ptr landing_pad, ip;
+ int ip_before_insn = 0;
if (version != 1)
return _URC_FATAL_PHASE1_ERROR;
@@ -110,7 +111,9 @@ PERSONALITY_FUNCTION (int version,
/* Parse the LSDA header. */
p = parse_lsda_header (context, language_specific_data, &info);
- ip = _Unwind_GetIP (context) - 1;
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+ if (! ip_before_insn)
+ --ip;
landing_pad = 0;
#ifdef __USING_SJLJ_EXCEPTIONS__
--- gcc/config/rs6000/linux.h.jj 2004-02-28 12:27:45.000000000 +0100
+++ gcc/config/rs6000/linux.h 2006-04-25 15:36:47.000000000 +0200
@@ -171,6 +171,7 @@ enum { SIGNAL_FRAMESIZE = 64 };
(FS)->regs.reg[CR0_REGNO].loc.offset \
= (long)&(sc_->regs->nip) - new_cfa_; \
(FS)->retaddr_column = CR0_REGNO; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
--- gcc/config/rs6000/linux64.h.jj 2004-10-29 09:35:44.000000000 +0200
+++ gcc/config/rs6000/linux64.h 2006-04-25 15:37:14.000000000 +0200
@@ -656,6 +656,7 @@ enum { SIGNAL_FRAMESIZE = 64 };
(FS)->regs.reg[ARG_POINTER_REGNUM].loc.offset \
= (long)&(sc_->regs->nip) - new_cfa_; \
(FS)->retaddr_column = ARG_POINTER_REGNUM; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
@@ -720,6 +721,7 @@ enum { SIGNAL_FRAMESIZE = 64 };
(FS)->regs.reg[CR0_REGNO].loc.offset \
= (long)&(sc_->regs->nip) - new_cfa_; \
(FS)->retaddr_column = CR0_REGNO; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
--- gcc/config/s390/linux.h.jj 2003-10-31 11:36:50.000000000 +0100
+++ gcc/config/s390/linux.h 2006-04-25 15:33:41.000000000 +0200
@@ -339,6 +339,7 @@ do {
} __attribute__ ((__aligned__ (8))) sigregs_; \
\
sigregs_ *regs_; \
+ int *signo_ = NULL; \
\
/* svc $__NR_sigreturn or svc $__NR_rt_sigreturn */ \
if (pc_[0] != 0x0a || (pc_[1] != 119 && pc_[1] != 173)) \
@@ -359,6 +360,7 @@ do {
} *uc_ = (CONTEXT)->cfa + 8 + 128; \
\
regs_ = &uc_->uc_mcontext; \
+ signo_ = (CONTEXT)->cfa + sizeof(long); \
} \
\
/* Old-style RT frame and all non-RT frames: \
@@ -367,6 +369,11 @@ do {
else \
{ \
regs_ = *(sigregs_ **)((CONTEXT)->cfa + 8); \
+ /* Recent kernels store the signal number immediately after \
+ the sigregs; old kernels have the return trampoline at \
+ this location. */ \
+ if ((void *)(regs_ + 1) != (CONTEXT)->ra) \
+ signo_ = (int *)(regs_ + 1); \
} \
\
new_cfa_ = regs_->gprs[15] + 16*sizeof(long) + 32; \
@@ -393,6 +400,12 @@ do {
(FS)->regs.reg[32].loc.offset = (long)®s_->psw_addr - new_cfa_; \
(FS)->retaddr_column = 32; \
\
+ /* SIGILL, SIGFPE and SIGTRAP are delivered with psw_addr \
+ after the faulting instruction rather than before it. \
+ Don't set FS->signal_frame in that case. */ \
+ if (!signo_ || (*signo_ != 4 && *signo_ != 5 && *signo_ != 8)) \
+ (FS)->signal_frame = 1; \
+ \
goto SUCCESS; \
} while (0)
--- gcc/config/i386/linux.h.jj 2003-06-11 14:56:49.000000000 +0200
+++ gcc/config/i386/linux.h 2006-04-25 15:33:41.000000000 +0200
@@ -280,6 +280,7 @@ Boston, MA 02111-1307, USA. */
(FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
(FS)->retaddr_column = 8; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
#endif /* ifndef inhibit_libc */
--- gcc/config/i386/linux64.h.jj 2003-06-11 14:56:49.000000000 +0200
+++ gcc/config/i386/linux64.h 2006-04-25 15:33:41.000000000 +0200
@@ -135,6 +135,7 @@ Boston, MA 02111-1307, USA. */
(FS)->regs.reg[16].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[16].loc.offset = (long)&sc_->rip - new_cfa_; \
(FS)->retaddr_column = 16; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
#else /* ifdef __x86_64__ */
@@ -189,6 +190,7 @@ Boston, MA 02111-1307, USA. */
(FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
(FS)->retaddr_column = 8; \
+ (FS)->signal_frame = 1; \
goto SUCCESS; \
} while (0)
#endif /* ifdef __x86_64__ */
--- gcc/config/ia64/unwind-ia64.c.jj 2004-07-01 12:49:33.000000000 +0200
+++ gcc/config/ia64/unwind-ia64.c 2006-04-25 15:33:41.000000000 +0200
@@ -1700,6 +1700,13 @@ _Unwind_GetIP (struct _Unwind_Context *c
return context->rp;
}
+inline _Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+ *ip_before_insn = 0;
+ return context->rp;
+}
+
/* Overwrite the return address for CONTEXT with VAL. */
inline void
--- gcc/unwind-sjlj.c.jj 2003-06-11 15:12:42.000000000 +0200
+++ gcc/unwind-sjlj.c 2006-04-25 15:33:44.000000000 +0200
@@ -197,6 +197,13 @@ _Unwind_GetIP (struct _Unwind_Context *c
return context->fc->call_site + 1;
}
+_Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+ *ip_before_insn = 0;
+ return context->fc->call_site + 1;
+}
+
/* Set the return landing pad index in CONTEXT. */
void
--- gcc/unwind.h.jj 2003-09-04 11:16:10.000000000 +0200
+++ gcc/unwind.h 2006-04-25 15:33:44.000000000 +0200
@@ -136,6 +136,7 @@ extern _Unwind_Word _Unwind_GetGR (struc
extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
/* @@@ Retrieve the CFA of the given context. */
--- gcc/unwind-dw2.c.jj 2003-07-16 13:38:32.000000000 +0200
+++ gcc/unwind-dw2.c 2006-04-25 15:33:44.000000000 +0200
@@ -62,6 +62,7 @@ struct _Unwind_Context
void *lsda;
struct dwarf_eh_bases bases;
_Unwind_Word args_size;
+ char signal_frame;
};
/* Byte size of every register managed by these routines. */
@@ -117,6 +118,7 @@ typedef struct
unsigned char fde_encoding;
unsigned char lsda_encoding;
unsigned char saw_z;
+ unsigned char signal_frame;
void *eh_ptr;
} _Unwind_FrameState;
@@ -193,6 +195,16 @@ _Unwind_GetIP (struct _Unwind_Context *c
return (_Unwind_Ptr) context->ra;
}
+/* Retrieve the return address and flag whether that IP is before
+ or after first not yet fully executed instruction. */
+
+inline _Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+ *ip_before_insn = context->signal_frame != 0;
+ return (_Unwind_Ptr) context->ra;
+}
+
/* Overwrite the return address for CONTEXT with VAL. */
inline void
@@ -304,6 +316,13 @@ extract_cie_info (struct dwarf_cie *cie,
aug += 1;
}
+ /* "S" indicates a signal frame. */
+ else if (aug[0] == 'S')
+ {
+ fs->signal_frame = 1;
+ aug += 1;
+ }
+
/* Otherwise we have an unknown augmentation string.
Bail unless we saw a 'z' prefix. */
else
@@ -736,8 +755,10 @@ execute_cfa_program (const unsigned char
a different stack configuration that we are not interested in. We
assume that the call itself is unwind info-neutral; if not, or if
there are delay instructions that adjust the stack, these must be
- reflected at the point immediately before the call insn. */
- while (insn_ptr < insn_end && fs->pc < context->ra)
+ reflected at the point immediately before the call insn.
+ In signal frames, return address is after last completed instruction,
+ so we add 1 to return address to make the comparison <=. */
+ while (insn_ptr < insn_end && fs->pc < context->ra + context->signal_frame)
{
unsigned char insn = *insn_ptr++;
_Unwind_Word reg, utmp;
@@ -927,7 +948,8 @@ uw_frame_state_for (struct _Unwind_Conte
context->args_size = 0;
context->lsda = 0;
- fde = _Unwind_Find_FDE (context->ra - 1, &context->bases);
+ fde = _Unwind_Find_FDE (context->ra + context->signal_frame - 1,
+ &context->bases);
if (fde == NULL)
{
/* Couldn't find frame unwind info for this function. Try a
@@ -1265,6 +1287,8 @@ uw_update_context_1 (struct _Unwind_Cont
break;
}
+ context->signal_frame = fs->signal_frame;
+
MD_FROB_UPDATE_CONTEXT (context, fs);
}
gcc32-rh173224.patch:
--- NEW FILE gcc32-rh173224.patch ---
2005-01-09 Alexandre Oliva <aoliva at redhat.com>
* config/i386/i386.md: Adjust sse conditional move patterns to
match both nonimm® and reg&nonimm in compare operands.
2006-04-25 Jakub Jelinek <jakub at redhat.com>
* gcc.dg/20060425-1.c: New test.
--- gcc/config/i386/i386.md 2005-10-24 18:18:40.000000000 -0200
+++ gcc/config/i386/i386.md 2006-01-09 16:16:06.000000000 -0200
@@ -16815,25 +16815,30 @@
(define_split
[(set (match_operand 0 "register_operand" "")
(if_then_else (match_operator 1 "comparison_operator"
- [(match_operand 4 "register_operand" "")
+ [(match_operand 4 "nonimmediate_operand" "")
(match_operand 5 "nonimmediate_operand" "")])
(match_operand 2 "nonmemory_operand" "")
(match_operand 3 "nonmemory_operand" "")))]
"SSE_REG_P (operands[0]) && reload_completed
+ && ((REG_P (operands[4]) && REGNO (operands[4]) == REGNO (operands[0]))
+ || (REG_P (operands[5]) && REGNO (operands[5]) == REGNO (operands[0])))
&& (const0_operand (operands[2], GET_MODE (operands[0]))
|| const0_operand (operands[3], GET_MODE (operands[0])))"
- [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)]))
+ [(set (match_dup 0) (match_op_dup 1 [(match_dup 4) (match_dup 5)]))
(set (subreg:TI (match_dup 0) 0) (and:TI (match_dup 6)
(subreg:TI (match_dup 7) 0)))]
{
PUT_MODE (operands[1], GET_MODE (operands[0]));
- if (!sse_comparison_operator (operands[1], VOIDmode))
+ if (REGNO (operands[4]) != REGNO (operands[0])
+ || !sse_comparison_operator (operands[1], VOIDmode))
{
rtx tmp = operands[5];
operands[5] = operands[4];
operands[4] = tmp;
PUT_CODE (operands[1], swap_condition (GET_CODE (operands[1])));
}
+ if (!sse_comparison_operator (operands[1], VOIDmode))
+ abort ();
if (const0_operand (operands[2], GET_MODE (operands[0])))
{
operands[7] = operands[3];
--- gcc/testsuite/gcc.dg/20060425-1.c 2004-06-24 14:04:38.000000000 -0400
+++ gcc/testsuite/gcc.dg/20060425-1.c 2006-04-25 09:15:04.000000000 -0400
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double
+crashme (double v, double *p)
+{
+ if (v < 0. && *p == 1.)
+ v = 0.;
+ return v;
+}
gcc32-rh180778.patch:
--- NEW FILE gcc32-rh180778.patch ---
2005-08-31 Richard Henderson <rth at redhat.com>
* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Force subregs
into a pseudo before applying gen_lowpart.
2005-08-30 Richard Henderson <rth at redhat.com>
PR target/23630
* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Use gen_lowpart
whenever the mode sizes match.
2002-08-19 Geoffrey Keating <geoffk at redhat.com>
Steve Ellcey <sje at cup.hp.com>
* machmode.h (SCALAR_INT_MODE_P): New macro to test for
scaler integer mode (MODE_INT or MODE_PARTIAL_INT).
2006-02-22 Alexandre Oliva <aoliva at redhat.com>
* gcc.dg/i386-mmx-3.c: New test.
--- gcc/convert.c.orig 2003-08-01 20:24:42.000000000 -0300
+++ gcc/convert.c 2006-02-24 03:51:35.000000000 -0300
@@ -398,7 +398,7 @@ convert_to_integer (type, expr)
error ("can't convert between vector values of different size");
return error_mark_node;
}
- return build1 (NOP_EXPR, type, expr);
+ return build1 (VIEW_CONVERT_EXPR, type, expr);
default:
error ("aggregate value used where an integer was expected");
@@ -478,7 +478,7 @@ convert_to_vector (type, expr)
error ("can't convert between vector values of different size");
return error_mark_node;
}
- return build1 (NOP_EXPR, type, expr);
+ return build1 (VIEW_CONVERT_EXPR, type, expr);
default:
error ("can't convert value to a vector");
--- gcc/expr.c.orig 2006-02-22 15:50:38.000000000 -0300
+++ gcc/expr.c 2006-02-24 04:49:59.000000000 -0300
@@ -7641,16 +7641,28 @@ expand_expr (exp, target, tmode, modifie
case VIEW_CONVERT_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
- /* If the input and output modes are both the same, we are done.
- Otherwise, if neither mode is BLKmode and both are within a word, we
- can use gen_lowpart. If neither is true, make sure the operand is
- in memory and convert the MEM to the new mode. */
+ /* If the input and output modes are both the same, we are done. */
if (TYPE_MODE (type) == GET_MODE (op0))
;
+ /* If neither mode is BLKmode, and both modes are the same size
+ then we can use gen_lowpart. */
else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
- && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_WORD
- && GET_MODE_SIZE (GET_MODE (op0)) <= UNITS_PER_WORD)
- op0 = gen_lowpart (TYPE_MODE (type), op0);
+ && GET_MODE_SIZE (TYPE_MODE (type))
+ == GET_MODE_SIZE (GET_MODE (op0)))
+ {
+ if (GET_CODE (op0) == SUBREG)
+ op0 = force_reg (GET_MODE (op0), op0);
+ op0 = gen_lowpart (TYPE_MODE (type), op0);
+ }
+ /* If both modes are integral, then we can convert from one to the
+ other. */
+ else if (SCALAR_INT_MODE_P (GET_MODE (op0))
+ && SCALAR_INT_MODE_P (TYPE_MODE (type)))
+ op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0,
+ TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp,
+ 0))));
+ /* As a last resort, spill op0 to memory, and reload it in a
+ different mode. */
else if (GET_CODE (op0) != MEM)
{
/* If the operand is not a MEM, force it into memory. Since we
--- gcc/machmode.h.orig 2002-02-19 07:13:31.000000000 -0300
+++ gcc/machmode.h 2006-02-24 04:20:47.000000000 -0300
@@ -75,6 +75,11 @@ extern const enum mode_class mode_class[
(GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT)
+/* Nonzero if MODE is a scalar integral mode. */
+#define SCALAR_INT_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_INT \
+ || GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT)
+
/* Get the size in bytes of an object of mode MODE. */
extern const unsigned char mode_size[NUM_MACHINE_MODES];
--- gcc/testsuite/gcc.dg/i386-mmx-3.c 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/gcc.dg/i386-mmx-3.c 2006-02-23 02:06:15.000000000 -0300
@@ -0,0 +1,20 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O -mmmx" } */
+
+#include <stdint.h>
+#include <mmintrin.h>
+
+void x(uint64_t *p_buffer)
+{
+ __m64 mm0, mm1;
+
+ mm0 = (__m64)(uint64_t)0;
+
+ /* This makes no sense whatsoever, it's just the result of
+ minimization of a large testcase. */
+ mm1 = _mm_srli_pi16(mm0, 0);
+ mm1 = _mm_slli_pi16(mm1, 1);
+ mm0 = _mm_adds_pi16(mm0, mm1);
+
+ *p_buffer = (uint64_t)mm0;
+}
gcc32-rh181894.patch:
--- NEW FILE gcc32-rh181894.patch ---
2006-08-09 Alexandre Oliva <aoliva at redhat.com>
* function.c (do_warn_unused_parameter): Do not issue warnings
for declarations in system headers.
2006-02-22 Alexandre Oliva <aoliva at redhat.com>
Backport and tweak:
2004-05-06 Jan Hubicka <jh at suse.cz>
PR c/15004
* function.c (do_warn_unused_parameter): Break out form ...
(expand_function_end): ... here.
* function.h (do_warn_unused_parameter): Declare.
2006-02-22 Alexandre Oliva <aoliva at redhat.com>
* decl2.c (finish_file): Issue warnings for unused parameters
of functions not expanded.
* g++.dg/Wunused-parm-1.C: New.
--- gcc/cp/decl2.c.orig 2003-08-12 11:12:25.000000000 -0300
+++ gcc/cp/decl2.c 2006-08-09 16:59:09.000000000 -0300
@@ -3551,6 +3551,17 @@ finish_file ()
}
while (reconsider);
+ if (warn_unused_parameter)
+ for (i = 0; i < deferred_fns_used; ++i)
+ {
+ tree decl = VARRAY_TREE (deferred_fns, i);
+
+ /* Warn about unused parameters in functions we refrained from
+ synthesizing. */
+ if (!TREE_ASM_WRITTEN (decl))
+ do_warn_unused_parameter (decl);
+ }
+
/* We give C linkage to static constructors and destructors. */
push_lang_context (lang_name_c);
--- gcc/function.c.orig 2003-10-31 08:42:15.000000000 -0200
+++ gcc/function.c 2006-08-10 00:28:06.000000000 -0300
@@ -6808,6 +6808,27 @@ use_return_register ()
diddle_return_value (do_use_return_reg, NULL);
}
+/* Warn about unused parms if extra warnings were specified. */
+/* Either ``-W -Wunused'' or ``-Wunused-parameter'' enables this
+ warning. WARN_UNUSED_PARAMETER is negative when set by
+ -Wunused. */
+void
+do_warn_unused_parameter (tree fn)
+{
+ if (warn_unused_parameter > 0
+ || (warn_unused_parameter < 0 && extra_warnings))
+ {
+ tree decl;
+
+ for (decl = DECL_ARGUMENTS (fn);
+ decl; decl = TREE_CHAIN (decl))
+ if (! TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
+ && DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl)
+ && ! DECL_IN_SYSTEM_HEADER (decl))
+ warning_with_decl (decl, "unused parameter `%s'");
+ }
+}
+
/* Generate RTL for the end of the current function.
FILENAME and LINE are the current position in the source file.
@@ -6907,21 +6928,8 @@ expand_function_end (filename, line, end
}
}
- /* Warn about unused parms if extra warnings were specified. */
- /* Either ``-W -Wunused'' or ``-Wunused-parameter'' enables this
- warning. WARN_UNUSED_PARAMETER is negative when set by
- -Wunused. */
- if (warn_unused_parameter > 0
- || (warn_unused_parameter < 0 && extra_warnings))
- {
- tree decl;
-
- for (decl = DECL_ARGUMENTS (current_function_decl);
- decl; decl = TREE_CHAIN (decl))
- if (! TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
- && DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
- warning_with_decl (decl, "unused parameter `%s'");
- }
+ if (warn_unused_parameter)
+ do_warn_unused_parameter (current_function_decl);
/* Delete handlers for nonlocal gotos if nothing uses them. */
if (nonlocal_goto_handler_slots != 0
--- gcc/function.h.orig 2003-06-11 09:56:49.000000000 -0300
+++ gcc/function.h 2006-08-09 16:59:09.000000000 -0300
@@ -614,3 +614,5 @@ extern void init_virtual_regs PARAMS ((
/* Called once, at initialization, to initialize function.c. */
extern void init_function_once PARAMS ((void));
+
+extern void do_warn_unused_parameter PARAMS ((tree));
--- gcc/testsuite/g++.dg/warn/Wunused-parm-1.C 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/warn/Wunused-parm-1.C 2006-08-09 16:59:09.000000000 -0300
@@ -0,0 +1,27 @@
+// Test whether we issue warnings for unused parameters, even for
+// inline functions that are not emitted (without optimization, we
+// always emit them).
+// { dg-do compile }
+// { dg-options "-Wunused-parameter -O" }
+
+static inline int foo(int var) { // { dg-warning "unused parameter" }
+ return 0;
+}
+
+static inline int foo2(int var) { // { dg-warning "unused parameter" }
+ return 0;
+}
+
+static inline int bar(int var) {
+ return var;
+}
+
+static inline int bar2(int var) {
+ return var;
+}
+
+int main() {
+ foo (1);
+ bar (2);
+ return 0;
+}
gcc32-rh186252.patch:
--- NEW FILE gcc32-rh186252.patch ---
2004-05-01 Ulrich Weigand <weigand at de.ibm.com>
PR middle-end/15054
* expr.c (expand_expr_real): Do not call preserve_temp_slots
on a TARGET_EXPR temp.
* function.c (assign_stack_temp_for_type): Set 'keep' flag for
TARGET_EXPR temp slots.
* g++.dg/opt/pr15054.C: New test.
2006-04-25 Jakub Jelinek <jakub at redhat.com>
* g++.dg/opt/pr15054-2.C: New test.
--- gcc/expr.c.orig 2006-02-24 04:51:46.000000000 -0300
+++ gcc/expr.c 2006-04-11 03:53:02.000000000 -0300
@@ -8676,8 +8676,6 @@ expand_expr (exp, target, tmode, modifie
else
{
target = assign_temp (type, 2, 0, 1);
- /* All temp slots at this level must not conflict. */
- preserve_temp_slots (target);
SET_DECL_RTL (slot, target);
if (TREE_ADDRESSABLE (slot))
put_var_into_stack (slot);
--- gcc/function.c.orig 2006-02-24 04:51:52.000000000 -0300
+++ gcc/function.c 2006-04-11 03:53:02.000000000 -0300
@@ -803,7 +803,7 @@ assign_stack_temp_for_type (mode, size,
if (keep == 2)
{
p->level = target_temp_slot_level;
- p->keep = 0;
+ p->keep = 1;
}
else if (keep == 3)
{
--- gcc/testsuite/g++.dg/opt/pr15054.C 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/opt/pr15054.C 2006-04-11 03:54:31.000000000 -0300
@@ -0,0 +1,36 @@
+// PR middle-end/15054
+// This used to abort due to overlapping stack temporaries.
+
+// { dg-do run }
+// { dg-options "-O" }
+
+extern "C" void abort (void);
+
+struct pointer
+{
+ void* ptr;
+
+ pointer(void* x = 0) : ptr(x) {}
+ pointer(const pointer& x) : ptr(x.ptr) {}
+};
+
+struct element
+{
+ int canary;
+
+ element() : canary(123) { }
+ ~element() { pointer(); if (canary != 123) abort (); }
+};
+
+inline pointer
+insert(const element& x)
+{
+ return pointer(new element(x));
+}
+
+int
+main (void)
+{
+ insert(element());
+ return 0;
+}
--- gcc/testsuite/g++.dg/opt/pr15054-2.C 2006-04-19 19:21:31.748476000 +0200
+++ gcc/testsuite/g++.dg/opt/pr15054-2.C 2006-04-25 15:55:07.000000000 +0200
@@ -0,0 +1,39 @@
+// PR middle-end/15054
+
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" void abort (void);
+
+void
+__attribute__((noinline))
+check (long x, long y)
+{
+ if (x != y)
+ abort ();
+}
+
+struct A
+{
+ A() : a(2) { check (a, 2); }
+ ~A() { check (a, 2); }
+private:
+ long a;
+};
+
+class B {
+ long b;
+ B& operator =(const B& );
+public:
+ B (long p) : b(p) { check (b, 6); }
+ B (const B& p) : b(p.b) { check (b, 6); }
+ ~B () { check (b, 6); A obj; check (b, 6); }
+ B foo() { return B(*this); }
+};
+
+int main ()
+{
+ B o(6);
+ o.foo().foo();
+ return 0;
+}
gcc32-rh226706.patch:
--- NEW FILE gcc32-rh226706.patch ---
2007-02-13 Alexandre Oliva <aoliva at redhat.com>
* reload1.c (fixup_abnormal_edges): Backport relevant portion of
fix for PR rtl-optimization/23601.
* g++.dg/eh/bz226706.C: New
--- gcc/reload1.c 2006-10-13 04:32:14.000000000 -0300
+++ gcc/reload1.c 2007-02-13 03:22:08.000000000 -0200
@@ -9524,7 +9524,10 @@ fixup_abnormal_edges ()
&& insn != bb->head)
insn = PREV_INSN (insn);
if (GET_CODE (insn) != CALL_INSN && !can_throw_internal (insn))
- abort ();
+ {
+ purge_dead_edges (bb);
+ continue;
+ }
bb->end = insn;
inserted = true;
insn = NEXT_INSN (insn);
--- gcc/testsuite/g++.dg/eh/bz226706.C 1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/eh/bz226706.C 2007-02-13 03:30:16.000000000 -0200
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fnon-call-exceptions -fPIC -O2" } */
+
+void foo() {
+ try {
+ float y = 10;
+ while (y > 0) {
+ double z = (y / 10);
+ y = z;
+ }
+ }
+ catch (...) {}
+}
Index: compat-gcc-32.spec
===================================================================
RCS file: /cvs/pkgs/rpms/compat-gcc-32/devel/compat-gcc-32.spec,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- compat-gcc-32.spec 21 Aug 2006 11:34:52 -0000 1.29
+++ compat-gcc-32.spec 9 Oct 2007 18:52:57 -0000 1.30
@@ -1,7 +1,7 @@
%define LIBSTDCXXDATE 20040818
%define DATE 20040701
%define gcc_version 3.2.3
-%define gcc_release 61
+%define gcc_release 62
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%define build_java 0
@@ -98,10 +98,20 @@
Patch45: gcc32-ppc64-stack-boundary.patch
Patch46: gcc32-pr12799.patch
Patch47: gcc32-pr13041.patch
-
-Patch50: gcc32-obstack-lvalues.patch
-Patch51: gcc32-fc4-compile.patch
-Patch52: gcc32-s390x-compile.patch
+Patch48: gcc32-pr26208.patch
+Patch49: gcc32-rh173224.patch
+Patch50: gcc32-rh180778.patch
+Patch51: gcc32-rh181894.patch
+Patch52: gcc32-rh186252.patch
+Patch53: gcc32-pr26208-workaround.patch
+Patch54: gcc32-libgcc_eh-hidden.patch
+Patch55: gcc32-java-zoneinfo.patch
+Patch56: gcc32-CVE-2006-3619.patch
+Patch57: gcc32-rh226706.patch
+
+Patch60: gcc32-obstack-lvalues.patch
+Patch61: gcc32-fc4-compile.patch
+Patch62: gcc32-s390x-compile.patch
Patch100: compat-libstdc++33-incdir.patch
Patch101: compat-libstdc++33-limits.patch
@@ -189,10 +199,20 @@
%patch45 -p0 -b .ppc64-stack-boundary~
%patch46 -p0 -b .pr12799~
%patch47 -p0 -b .pr13041~
-
-%patch50 -p0 -b .obstack-lvalues~
-%patch51 -p0 -b .fc4-compile~
-%patch52 -p0 -b .s390x-compile~
+%patch48 -p0 -b .pr26208~
+%patch49 -p0 -b .rh173224~
+%patch50 -p0 -b .rh180778~
+%patch51 -p0 -b .rh181894~
+%patch52 -p0 -b .rh186252~
+%patch53 -p0 -b .pr26208-workaround~
+%patch54 -p0 -b .libgcc_eh-hidden~
+%patch55 -p0 -b .java-zoneinfo~
+%patch56 -p0 -b .CVE-2006-3619~
+%patch57 -p0 -b .rh226706~
+
+%patch60 -p0 -b .obstack-lvalues~
+%patch61 -p0 -b .fc4-compile~
+%patch62 -p0 -b .s390x-compile~
%patch100 -p0 -b .compat-libstdc++33-incdir~
%patch101 -p0 -b .compat-libstdc++33-limits~
@@ -226,6 +246,15 @@
mkdir obj-%{gcc_target_platform}
cd obj-%{gcc_target_platform}
+mkdir -p ld_hack
+cat > ld_hack/ld <<\EOF
+#!/bin/sh
+case " $* " in *\ -r\ *) exec /usr/bin/ld "$@";; esac
+exec /usr/bin/ld --build-id "$@"
+EOF
+chmod 755 ld_hack/ld
+export PATH=`pwd`/ld_hack/${PATH:+:$PATH}
+
if [ ! -f /usr/lib/locale/de_DE/LC_CTYPE ]; then
mkdir locale
localedef -f ISO-8859-1 -i de_DE locale/de_DE
@@ -317,6 +346,8 @@
%install
rm -fr $RPM_BUILD_ROOT
+export PATH=`pwd`/obj-%{gcc_target_platform}/ld_hack/${PATH:+:$PATH}
+
perl -pi -e \
's~href="l(ibstdc|atest)~href="http://gcc.gnu.org/onlinedocs/libstdc++/l\1~' \
libstdc++-v3/docs/html/documentation.html
@@ -402,6 +433,9 @@
%{_prefix}/%{_lib}/libstdc++.so.5*
%changelog
+* Tue Oct 9 2007 Jakub Jelinek <jakub at redhat.com> 3.2.3-62
+- rebuilt
+
* Mon Aug 21 2006 Jakub Jelinek <jakub at redhat.com> 3.2.3-61
- fix the ppc*/s390* math *l stub changes
More information about the fedora-extras-commits
mailing list