Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson  wrote:
> On 04/18/2012 05:39 AM, Jan Hubicka wrote:
>> Well, if SJLJ lowering happens as gimple pass somewhere near the end of 
>> gimple
>> queue, this should not be problem at all. (and implementation would be 
>> cleaner)
>
> If you can find a clean way of separating sjlj expansion from dw2 expansion,
> please do.  But there's a lot of code shared between the two.  I see nothing
> wrong with always expanding via tablejump.

In that case, would something like the following patch be acceptable?
I have verified that all targets that always set
TARGET_EXCEPT_UNWIND_INFO define casesi and/or tablejump.


* toplev.c (process_options): Fail for sjlj exceptions if the
target machine
has no casesi insn and no tablejump insn.

Index: toplev.c
===
--- toplev.c(revision 187394)
+++ toplev.c(working copy)
@@ -1265,6 +1265,16 @@ process_options (void)
   "and -ftree-loop-linear)");
 #endif

+#if !defined(HAVE_casesi) && !defined(HAVE_tablejump)
+  if (flag_exceptions
+  && targetm_common.except_unwind_info (&global_options) == UI_SJLJ)
+{
+  sorry ("setjmp/longjmp-based exception handling not supported "
+"on this target machine "
+"(required % or % insns are not present)");
+}
+#endif
+
   if (flag_mudflap && flag_lto)
 sorry ("mudflap cannot be used together with link-time optimization");


Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Jan Hubicka
> On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson  wrote:
> > On 04/18/2012 05:39 AM, Jan Hubicka wrote:
> >> Well, if SJLJ lowering happens as gimple pass somewhere near the end of 
> >> gimple
> >> queue, this should not be problem at all. (and implementation would be 
> >> cleaner)
> >
> > If you can find a clean way of separating sjlj expansion from dw2 expansion,
> > please do.  But there's a lot of code shared between the two.  I see nothing
> > wrong with always expanding via tablejump.
> 
> In that case, would something like the following patch be acceptable?
> I have verified that all targets that always set
> TARGET_EXCEPT_UNWIND_INFO define casesi and/or tablejump.
> 
> 
> * toplev.c (process_options): Fail for sjlj exceptions if the
> target machine
> has no casesi insn and no tablejump insn.

Isn't SJLJ used by default for Ada on all targets?

Honza


Add STB_SECONDARY to gABI

2012-05-12 Thread H.J. Lu
Here is the final proposal to add STB_SECONDARY to gABI.
Any comments?

Thanks.

-- 
H.J.
---
We want to provide a relocatable object which can take advantage of all
versions of a supported OS.  For a function, foo, in the C library, we
can use it only if it is available on all versions of the C library or
we provide our own implementation of foo.  With our own foo, the one in
the C library will never be used.  Here is a proposal to add STB_SECONDARY
to gABI to support the secondary definition so that a software vendor
can provide an alternative implementation in case it isn't available
in the C library.

STB_SECONDARY

  Secondary symbols are similar to weak symbols, but their definitions
  have even lower precedence.  The difference between secondary symbols
  and weak symbols are

1. The link editor must search archive library and extract
archive members to resolve defined and undefined secondary symbol.
2.  When the link editor searches a shared object, it must honor
the global or weak definition in the shared object and ignore the
secondary one with the same name.
3. The link editor ignores the secondary definition if there is
a global, weak or common definition with the same name.  Multiple
secondary definitions with the same name will not cause an error.
The first appearance of the secondary definition should be honored
and the rest are ignored.
4. The link editor may treat the secondary definition in the
shared object as a global definition.
5. Unresolved secondary symbols have a zero value.

  The purpose of this symbol binding is to provide the primary
  definition as a global, weak or common symbol in an archive library
  or a shared object while keeping a secondary definition in a
  relocatable object.  If there is no primary definition, the
  secondary definition will be used.

  When secondary definitions become part of an executable or shared
  object, linker may convert them to global or local definitions.

  At run-time, when resolving a symbol, after seeing a secondary
  definition, the dynamic linker must keep searching until a
  global or weak definition is found.  If a global or weak
  definition is found, it will be used to satisfy the symbol lookup.
  Otherwise, the secondary definition will be used.

  If the dlopen loads a global or weak definition after the program
  has already resolved references to a secondary definition, those
  references remain bound to the secondary definition.  Any
  references resolved after the dlopen, for which the dlopened
  module is included in the module search list, would be resolved
  to the global or weak definition.

STB_SECONDARY is defined as:

#define STB_SECONDARY   3   /* Secondary symbol */


Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Steven Bosscher
On Sat, May 12, 2012 at 3:49 PM, Jan Hubicka  wrote:
>> On Wed, Apr 18, 2012 at 2:44 PM, Richard Henderson  wrote:
>> > On 04/18/2012 05:39 AM, Jan Hubicka wrote:
>> >> Well, if SJLJ lowering happens as gimple pass somewhere near the end of 
>> >> gimple
>> >> queue, this should not be problem at all. (and implementation would be 
>> >> cleaner)
>> >
>> > If you can find a clean way of separating sjlj expansion from dw2 
>> > expansion,
>> > please do.  But there's a lot of code shared between the two.  I see 
>> > nothing
>> > wrong with always expanding via tablejump.
>>
>> In that case, would something like the following patch be acceptable?
>> I have verified that all targets that always set
>> TARGET_EXCEPT_UNWIND_INFO define casesi and/or tablejump.
>>
>>
>>         * toplev.c (process_options): Fail for sjlj exceptions if the
>> target machine
>>         has no casesi insn and no tablejump insn.
>
> Isn't SJLJ used by default for Ada on all targets?

Would that make a difference for whether this patch is OK or not?

I also have no problems leaving the switch expanding code in stmt.c,
and just adding new code for switch lowering as a GIMPLE pass. That
way (of least resistance) SJLJ exception dispatches can continue to be
expanded as decision trees. Just tell me what you want.

Ciao!
Steven


Re: What do do with the exceptional case of expand_case for SJLJ exceptions

2012-05-12 Thread Eric Botcazou
> Isn't SJLJ used by default for Ada on all targets?

Nope, Ada uses the same EH scheme as the other compilers, except for a few 
cases where it uses its own __builtin_setjmp/__builtin_longjmp based scheme.

-- 
Eric Botcazou


R: CLOOG-PPL fails to build (OS X)

2012-05-12 Thread erotavlas_tu...@libero.it
Hi,

you have to add the configure option ./configure --with-ppl=/path.

Best Regards

Salvatore

>Messaggio originale
>Da: obog...@yahoo.com
>Data: 12/05/2012 1.54
>A: 
>Ogg: CLOOG-PPL fails to build (OS X)
>
>I am trying to build GCC 4.7.0 on OS X.
>I have compiled and installed (via make install) GMP, MPFR, MPC and PPL 
0.11.
>However when I am trying to build CLOOG-PPL 0.15.11 it fails to build.
>
>During ./configure it says:
>
>checking for location of PolyLib... installed in standard location
>checking for PolyhedronTSort in -lpolylib64... no
>Can't find PolyLib.
>checking for Parma Polyhedral Library (PPL)... not using PPL
>
>Then during make it fails with messages starting with:
>
>source/../include/cloog/cloog.h:47:30: error: polylib/missing.h: No 
such 
>file or directory
>
>and more errors following this first one.
>
>Please advise how I may work around  this.
>Thanks.
>
>




gcc-4.7-20120512 is now available

2012-05-12 Thread gccadmin
Snapshot gcc-4.7-20120512 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.7-20120512/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.7 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch 
revision 187430

You'll find:

 gcc-4.7-20120512.tar.bz2 Complete GCC

  MD5=11f00dd8858843600adc3abf62e74c9c
  SHA1=0f2edecb9eea6a96f93a0b4898f9da8616ace42b

Diffs from 4.7-20120505 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.7
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.