From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41908 invoked by alias); 7 Mar 2015 16:55:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 41868 invoked by uid 48); 7 Mar 2015 16:55:20 -0000 From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65342] [5 Regression] FAIL: gfortran.dg/intrinsic_(un)?pack_1.f90 -O1 execution test on powerpc-apple-darwin9 after r210201 Date: Sat, 07 Mar 2015 16:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00798.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65342 --- Comment #3 from Iain Sandoe --- (In reply to Dominique d'Humieres from comment #2) > > Confirmed. The problem occurs in fwprop1 where instructions correspond= ing to the > > following assembly > > addis r2,r31,ha16(_A.1.1600-L1$pb) > > la r9,lo16(_A.1.1600-L1$pb)(r2) > > ld r2,0(r9) > > are combined to > > addis r2,r31,ha16(_A.1.1600-L1$pb) > > la r9,lo16(_A.1.1600-L1$pb)(r2) > > ld r2,lo16(_A.1.1600-L1$pb)(r2) > > ie. the offset is propagated into the memory load. This ought to give = you > > an error at assembly or link time. >=20 > No error at assembly or link time. > > If not, you have a bad assembler or linker.. >=20 > Well, we'll have to live with them!-(EOL target). The system as is based on gas-1.38 and doesn't warn for this :-( ld64 is slightly better and does catch a few more cases (where they resolve= at link-time). .. there's some hope for my WIP GAS port and an updated ld64 (yeah, I know = it's taking a long time for these to appear) .. > > movdi_low is the culprit, I think. It should require a suitably aligned > > offset (operand 2). >=20 > How? In the mdynamic-no-pic case, the literal value should work the same as for linux. In the case of PIC, I suspect we need to look through the uspecs that wrap mach-o PIC offsets and try to determine if the alignment of the referenced symbol is guaranteed to be "enough". The alignment of the picbase will alw= ays be >=3D 4. Some time ago I had a WIP patch to try and deal with this =E2=80=A6 but it'= s bit-rotted so needs a significant re-visit. >>From gcc-bugs-return-479655-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Mar 07 17:16:19 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 68161 invoked by alias); 7 Mar 2015 17:16:18 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 68148 invoked by uid 48); 7 Mar 2015 17:16:14 -0000 From: "jezz at hkfree dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65344] New: Exception is not catched on AIX - class with more ancestors, virtual method throws Date: Sat, 07 Mar 2015 17:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jezz at hkfree dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00799.txt.bz2 Content-length: 5401 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65344 Bug ID: 65344 Summary: Exception is not catched on AIX - class with more ancestors, virtual method throws Product: gcc Version: 4.8.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jezz at hkfree dot org Created attachment 34983 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34983&action=edit Sources for reproducing In my program exception is not catched, when it is compiled with gcc newer than 4.4 (4.2.4 & 4.4.7 works). I have created sample (sample with Makefile in in attachment). I have tested the sample with 4.5.4 and 4.8.3 - both fails. All compilers are from http://www.perzl.org/aix/index.php?n=Main.Gcc This is output from sample compiled with 4.4.7: ./main Case 1: Case 2: (Class*)ThrowingClass=0x0x200013b8 (DoThrowIface*)this=0x0x200013bc (DoThrowIface*)ThrowingClass=0x0x200013bc Called doThrow. Thrown && catched BaseException. End. This is output from sample compiled with 4.8.3: ./main Case 1: Case 2: (Class*)ThrowingClass=0x0x20001ab8 (DoThrowIface*)this=0x0x20001abc (DoThrowIface*)ThrowingClass=0x0x20001abc Called doThrow. terminate called after throwing an instance of 'Exception' (gdb) where #0 0xd37bd440 in raise () from /usr/lib/libc.a(shr.o) #1 0xd384bca8 in abort () from /usr/lib/libc.a(shr.o) #2 0xd8055610 in __gnu_cxx::__verbose_terminate_handler () at _start_ :95 #3 0xd80609ec in __cxxabiv1::__terminate (handler=) at _start_ :38 #4 0xd8055404 in std::terminate () at _start_ :48 #5 0xd8060d7c in __cxa_throw (obj=, tinfo=, dest=) at _start_ :87 #6 0x10001604 in ThrowingClass::doThrow (this=0x20001ab8) at throwing_class.cc:24 #7 0x100006a8 in main (argc=1, argv=0x2ff22af4) at main.cc:39 g++ -v: Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.3/lto-wrapper Target: powerpc-ibm-aix6.1.0.0 Configured with: ../gcc-4.8.3/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --host=powerpc-ibm-aix6.1.0.0 Thread model: aix gcc version 4.8.3 (GCC) Sample sources: base.hh: #ifndef BASE_HH #define BASE_HH 1 class Exception { public: Exception() {} }; class Iface { public: virtual ~Iface() {} }; class Class { public: virtual ~Class() {} virtual Iface *getIface() = 0; }; class DoThrowIface : public Iface { public: virtual void doThrow() = 0; }; class Registrator { public: virtual Class* getClass() = 0; }; #endif /* BASE_HH */ throwing_class.hh: #ifndef THROWING_CLASS_HH #define THROWING_CLASS_HH 1 class ThrowingClass : public Class , public DoThrowIface { public: virtual void doThrow(); virtual Iface *getIface(); }; #endif /* THROWING_CLASS_HH */ throwing_class.cc: #include #include "base.hh" #include "throwing_class.hh" extern Registrator *reg; // This class must be in separate object file class ThrowingClassRegistrator : public Registrator { public: ThrowingClassRegistrator() { reg = this; } virtual Class *getClass() { return new ThrowingClass(); } } ThrowingClassRegistrator_I; void ThrowingClass::doThrow() { std::cout << "Called doThrow." << std::endl; throw Exception(); } Iface *ThrowingClass::getIface() { std::cout << "(DoThrowIface*)this=0x" << (DoThrowIface*)this << std::endl; return static_cast(this); } main.cc: #include #include #include "base.hh" #include "throwing_class.hh" Registrator *reg; int main(int argc, char *argv[]) { std::cout << "Case 1:" << std::endl; try { // This always works, but if I uncomment this, case 2 is also working. /* Class *throwingClass = new ThrowingClass(); std::cout << "(Class*)ThrowingClass=0x" << throwingClass << std::endl; DoThrowIface *throwIface = (DoThrowIface *)throwingClass->getIface(); std::cout << "(DoThrowIface*)ThrowingClass=0x" << throwIface << std::endl; throwIface->doThrow(); //*/ } catch (Exception const& e) { std::cout << "Thrown && catched BaseException." << std::endl; } catch (...) { std::cout << "General catch." << std::endl; } std::cout << std::endl << "Case 2:" << std::endl; try { Class *throwingClass = reg->getClass(); std::cout << "(Class*)ThrowingClass=0x" << throwingClass << std::endl; DoThrowIface *throwIface = (DoThrowIface *)throwingClass->getIface(); std::cout << "(DoThrowIface*)ThrowingClass=0x" << throwIface << std::endl; throwIface->doThrow(); } catch (Exception const& e) { std::cout << "Thrown && catched BaseException." << std::endl; } catch (...) { std::cout << "General catch." << std::endl; } std::cout << "End." << std::endl; return 0; }