Commit d0dcb2b1 by Arnaud Charlet

[multiple changes]

2011-11-23  Thomas Quinot  <quinot@adacore.com>

	* thread.c, s-oscons-tmplt.c: Generate __gnat_pthread_condattr_setup
	only on platforms where this is required, as determined by
	s-oscons.h.

2011-11-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch9.adb: No check on entry index if error on index.

2011-11-23  Gary Dismukes  <dismukes@adacore.com>

	* sem_ch6.adb (Analyze_Return_Statement): Improve error messages for
	return statements nested inside an extended_return_statement.
	* gcc-interface/Make-lang.in: Update dependencies.
	* gcc-interface/Makefile.in (MISCLIB): Add -lutil for BSD targets.

From-SVN: r181670
parent db3dd8af
2011-11-23 Thomas Quinot <quinot@adacore.com>
* thread.c, s-oscons-tmplt.c: Generate __gnat_pthread_condattr_setup
only on platforms where this is required, as determined by
s-oscons.h.
2011-11-23 Ed Schonberg <schonberg@adacore.com>
* sem_ch9.adb: No check on entry index if error on index.
2011-11-23 Gary Dismukes <dismukes@adacore.com>
* sem_ch6.adb (Analyze_Return_Statement): Improve error messages for
return statements nested inside an extended_return_statement.
* gcc-interface/Make-lang.in: Update dependencies.
* gcc-interface/Makefile.in (MISCLIB): Add -lutil for BSD targets.
2011-11-23 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_All_Ent): An incomplete type is not
......
......@@ -4047,7 +4047,7 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/itypes.ads ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
ada/lib-load.ads ada/lib-sort.adb ada/lib-util.ads ada/lib-xref.ads \
ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/opt.adb ada/output.ads ada/par_sco.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/par_sco.ads \
ada/put_alfa.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
ada/rtsfind.ads ada/scans.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
ada/sem_aux.ads ada/sem_aux.adb ada/sem_case.ads ada/sem_case.adb \
......@@ -4245,23 +4245,24 @@ ada/sem_ch8.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads \
ada/sem.ads ada/sem.adb ada/sem_aggr.ads ada/sem_attr.ads \
ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads ada/sem_ch10.ads \
ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch8.adb ada/sem_ch9.ads \
ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
ada/sem_eval.ads ada/sem_intr.ads ada/sem_prag.ads ada/sem_res.ads \
ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
ada/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch13.adb \
ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch8.adb \
ada/sem_ch9.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_prag.ads \
ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \
ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-exctab.ads \
ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads ada/warnsw.ads ada/widechar.ads
ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
......
......@@ -1156,6 +1156,7 @@ ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
GNATLIB_SHARED = gnatlib-shared-dual
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)
MISCLIB = -lutil
endif
ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(arch) $(osys))),)
......@@ -1209,6 +1210,7 @@ ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
THREADSLIB= -lpthread
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)
MISCLIB = -lutil
endif
ifeq ($(strip $(filter-out %86_64 freebsd%,$(arch) $(osys))),)
......@@ -1235,6 +1237,7 @@ ifeq ($(strip $(filter-out %86_64 freebsd%,$(arch) $(osys))),)
THREADSLIB= -lpthread
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)
MISCLIB = -lutil
endif
ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
......
......@@ -1360,13 +1360,22 @@ CND(CLOCK_SGI_FAST, "SGI fast clock")
CND(CLOCK_SGI_CYCLE, "SGI CPU clock")
#endif
#ifndef CLOCK_THREAD_CPUTIME_ID
# define CLOCK_THREAD_CPUTIME_ID -1
#endif
CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
#if defined(__APPLE__)
/* There's no clock_gettime or clock_id's on Darwin */
/* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
# define CLOCK_RT_Ada "-1"
#elif defined(FreeBSD) || defined(_AIX)
/* On these platforms use system provided monotonic clock */
#elif defined(FreeBSD) || (defined(_AIX) && defined(_AIXVERSION_530))
/** On these platforms use system provided monotonic clock instead of
** the default CLOCK_REALTIME. We then need to set up cond var attributes
** appropriately (see thread.c).
**/
# define CLOCK_RT_Ada "CLOCK_MONOTONIC"
# define NEED_PTHREAD_CONDATTR_SETCLOCK
#elif defined(CLOCK_REALTIME)
/* By default use CLOCK_REALTIME */
......@@ -1377,11 +1386,6 @@ CND(CLOCK_SGI_CYCLE, "SGI CPU clock")
CNS(CLOCK_RT_Ada, "")
#endif
#ifndef CLOCK_THREAD_CPUTIME_ID
# define CLOCK_THREAD_CPUTIME_ID -1
#endif
CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
#if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
/*
......
......@@ -1485,9 +1485,19 @@ package body Sem_Ch6 is
-- extended_return_statement.
if Returns_Object then
Error_Msg_N
("extended_return_statement cannot return value; " &
"use `""RETURN;""`", N);
if Nkind (N) = N_Extended_Return_Statement then
Error_Msg_N
("extended return statements cannot be nested; use `RETURN;`",
N);
-- Case of a simple return statement with a value inside extended
-- return statement.
else
Error_Msg_N
("return nested in extended return statement cannot return " &
"value; use `RETURN;`", N);
end if;
end if;
else
......
......@@ -924,8 +924,13 @@ package body Sem_Ch9 is
UBR : Node_Id;
begin
-- No bounds checking if the type is generic or if previous error.
-- In an instance the check is dynamic.
if Is_Generic_Type (Etype (D_Sdef))
or else In_Instance
or else Error_Posted (D_Sdef)
then
goto Skip_LB;
......@@ -951,6 +956,7 @@ package body Sem_Ch9 is
<<Skip_LB>>
if Is_Generic_Type (Etype (D_Sdef))
or else In_Instance
or else Error_Posted (D_Sdef)
then
goto Skip_UB;
......
......@@ -2,7 +2,7 @@
* *
* GNAT COMPILER COMPONENTS *
* *
* T H R E A D *
* P T H R E A D *
* *
* C Implementation File *
* *
......@@ -31,20 +31,27 @@
/* This file provides utility functions to access the threads API */
#include <pthread.h>
#include <time.h>
#include "s-oscons.h"
#ifdef NEED_PTHREAD_CONDATTR_SETCLOCK
# include <pthread.h>
# include <time.h>
int
__gnat_pthread_condattr_setup(pthread_condattr_t *attr) {
/*
* If using a clock other than CLOCK_REALTIME for the Ada Monotonic_Clock,
* the corresponding clock id must be set for condition variables.
* There are no clock_id's on Darwin.
*/
#if defined(__APPLE__) || ((CLOCK_RT_Ada) == (CLOCK_REALTIME))
return 0;
#else
return pthread_condattr_setclock (attr, CLOCK_RT_Ada);
#endif
}
#else
int
__gnat_pthread_condattr_setup (void *attr) {
/* Dummy version for other platforms, which may or may not have pthread.h */
return 0;
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment