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]

Re: PATCH: Support priority argument for constructor/destructor arguments


On Sat, 24 Feb 2007, Mark Mitchell wrote:

> * I added several new test cases.  I also noticed that the C++ tests
>   for init_priority had an outdated approach to determining whether
>   the target supported the attribute (which requires linker support),
>   so I created a new effective target in target-supports.exp.
>
> Index: testsuite/lib/target-supports.exp
> ===================================================================
> --- testsuite/lib/target-supports.exp	(revision 122273)
> +++ testsuite/lib/target-supports.exp	(working copy)
> @@ -2089,6 +2089,23 @@ proc check_effective_target_dummy_wcsfti
>      return [check_effective_target_uclibc]
>  }
>
> +# Return 1 if constructors with initialization priority arguments are
> +# supposed on this target.
> +
> +proc check_effective_target_init_priority {} {
> +    # On Solaris2, initialization priorities are only supported with
> +    # GNU ld, but the compiler accepts them even when using Sun ld.
> +    # For more information, see PR 6482.
> +    if { [istarget *-solaris2*] } {
> +	return 1
> +    }
> +
> +    return [check_no_compiler_messages init_priority assembly "
> +	void f() __attribute__((constructor (1000)));
> +	void f() \{\}
> +    "]
> +}

Hi Mark,

I'm not sure the implementation of check_effective_target_init_priority is
the right approach for Solaris2, I'm getting several failures with the
native linker:

> FAIL: g++.dg/special/conpr-1.C (test for excess errors)
> WARNING: g++.dg/special/conpr-1.C compilation failed to produce executable
> FAIL: g++.dg/special/conpr-2.C (test for excess errors)
> WARNING: g++.dg/special/conpr-2.C compilation failed to produce executable
> FAIL: g++.dg/special/conpr-3.C (test for excess errors)
> WARNING: g++.dg/special/conpr-3.C compilation failed to produce executable
> FAIL: g++.dg/special/conpr-4.C (test for excess errors)
> WARNING: g++.dg/special/conpr-4.C compilation failed to produce executable
> FAIL: g++.dg/special/initp1.C (test for excess errors)
> WARNING: g++.dg/special/initp1.C compilation failed to produce executable
> FAIL: g++.dg/special/initpri1.C execution test
> FAIL: gcc.dg/initpri1.c execution test

I'm sure these are preexisting, but they used to be XFAIL'ed or something.
The compile failures look like this:

conpr-1.C:12: error: 'init_priority' attribute is not supported on this platform

IMHO, you should take out the solaris2 hardcode and add an init_priority
compile-time check along side the constructor one.  Given it's name, the
procedure is supposedly checking for init_priority, not constructor,
right?  That would bypass all the conpr*/initp1* compile-time failures.

That would still leave the runtime failures in initpri1.[Cc].  To address
that I believe the procedure (or another one) should do a runtime check as
well and xfail the run tests or something like that.  We're starting to
get outside my dejagnu expertise here. :-)  I'm open to suggestions.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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