Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2001-03-23  Jes Sorensen  <jes@linuxcare.com>

	* sysdeps/unix/sysv/linux/ia64/sysdep.h (ENTRY): Moved to ...
	* sysdeps/ia64/sysdep.h: ...here.

	* sysdeps/ia64/sysdep.h (LOCAL_ENTRY): Define.
	* sysdeps/ia64/sysdep.h (LOCAL_LEAF): Define.

	* sysdeps/ia64/_mcount.S (_mcount_ret_helper): Use LOCAL_LEAF() to
	declare instead of LEAF().  Suggestion from David Mosberger.

2001-03-21  David Mosberger  <davidm@hpl.hp.com>

	* sysdeps/unix/sysv/linux/ia64/sysdep.h (CALL_MCOUNT): Add unwind
	directives.
	(PSEUDO): Drop .psr and .lsb directives.

	* sysdeps/unix/sysv/linux/ia64/setjmp.S: Ditto.  Add unwind
	directives.
	* sysdeps/unix/sysv/linux/ia64/sysdep.S: Ditto.

	* sysdeps/ia64/elf/start.S: Misc cleanup: remove .psr and .lsb
	directives etc.
	* sysdeps/unix/sysv/linux/ia64/brk.S: Ditto.
	* sysdeps/unix/sysv/linux/ia64/__longjmp.S: Ditto.
	* sysdeps/ia64/_mcount.S: Remove .psr and .lsb directives (no
	longer needed).  Add unwind directives.

	* sysdeps/ia64/sysdep.h: Define ASM_UNW_PRLG_RP, ASM_UNW_PRLG_PFS,
	ASM_UNW_PRLG_PSP, ASM_UNW_PRLG_PR, and ASM_UNW_PRLG_GRSAVE.

2001-03-21  Paul Eggert  <eggert@twinsun.com>

	* posix/regex.h (RE_INVALID_INTERVAL_ORD): New macro.
	(RE_SYNTAX_POSIX_EGREP): Use it.
	* posix/regex.c (regex_compile): Implement it.

2001-03-21  Paul Eggert  <eggert@twinsun.com>

	* posix/regex.c (GET_UNSIGNED_NUMBER): Check for overflow.
	Rewrite to avoid duplicate code.

2001-03-21  H.J. Lu  <hjl@gnu.org>

	* elf/Makefile (tests): Don't depend on $(objpfx)tst-pathopt.out
	for cross-compiling.
	($(objpfx)tst-pathopt.out): Undo the last change.
  • Loading branch information
Ulrich Drepper committed Mar 25, 2001
1 parent 8c0fe29 commit 0a45b76
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 190 deletions.
48 changes: 48 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
2001-03-23 Jes Sorensen <jes@linuxcare.com>

* sysdeps/unix/sysv/linux/ia64/sysdep.h (ENTRY): Moved to ...
* sysdeps/ia64/sysdep.h: ...here.

* sysdeps/ia64/sysdep.h (LOCAL_ENTRY): Define.
* sysdeps/ia64/sysdep.h (LOCAL_LEAF): Define.

* sysdeps/ia64/_mcount.S (_mcount_ret_helper): Use LOCAL_LEAF() to
declare instead of LEAF(). Suggestion from David Mosberger.

2001-03-21 David Mosberger <davidm@hpl.hp.com>

* sysdeps/unix/sysv/linux/ia64/sysdep.h (CALL_MCOUNT): Add unwind
directives.
(PSEUDO): Drop .psr and .lsb directives.

* sysdeps/unix/sysv/linux/ia64/setjmp.S: Ditto. Add unwind
directives.
* sysdeps/unix/sysv/linux/ia64/sysdep.S: Ditto.

* sysdeps/ia64/elf/start.S: Misc cleanup: remove .psr and .lsb
directives etc.
* sysdeps/unix/sysv/linux/ia64/brk.S: Ditto.
* sysdeps/unix/sysv/linux/ia64/__longjmp.S: Ditto.
* sysdeps/ia64/_mcount.S: Remove .psr and .lsb directives (no
longer needed). Add unwind directives.

* sysdeps/ia64/sysdep.h: Define ASM_UNW_PRLG_RP, ASM_UNW_PRLG_PFS,
ASM_UNW_PRLG_PSP, ASM_UNW_PRLG_PR, and ASM_UNW_PRLG_GRSAVE.

2001-03-21 Paul Eggert <eggert@twinsun.com>

* posix/regex.h (RE_INVALID_INTERVAL_ORD): New macro.
(RE_SYNTAX_POSIX_EGREP): Use it.
* posix/regex.c (regex_compile): Implement it.

2001-03-21 Paul Eggert <eggert@twinsun.com>

* posix/regex.c (GET_UNSIGNED_NUMBER): Check for overflow.
Rewrite to avoid duplicate code.

2001-03-21 H.J. Lu <hjl@gnu.org>

* elf/Makefile (tests): Don't depend on $(objpfx)tst-pathopt.out
for cross-compiling.
($(objpfx)tst-pathopt.out): Undo the last change.

2001-03-24 Mark Kettenis <kettenis@gnu.org>

* sysdeps/mach/hurd/i386/bits/sigcontext.h (sc_sp, sc_fp, sc_pc,
Expand Down
118 changes: 46 additions & 72 deletions posix/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2138,21 +2138,21 @@ typedef struct


/* Get the next unsigned number in the uncompiled pattern. */
#define GET_UNSIGNED_NUMBER(num) \
{ if (p != pend) \
{ \
PATFETCH (c); \
while ('0' <= c && c <= '9') \
{ \
if (num < 0) \
num = 0; \
num = num * 10 + c - '0'; \
if (p == pend) \
break; \
PATFETCH (c); \
} \
} \
}
#define GET_UNSIGNED_NUMBER(num) \
{ \
while (p != pend) \
{ \
PATFETCH (c); \
if (c < '0' || c > '9') \
break; \
if (num <= RE_DUP_MAX) \
{ \
if (num < 0) \
num = 0; \
num = num * 10 + c - '0'; \
} \
} \
}

#if defined _LIBC || WIDE_CHAR_SUPPORT
/* The GNU C library provides support for user-defined character classes
Expand Down Expand Up @@ -2326,14 +2326,6 @@ regex_compile (pattern, size, syntax, bufp)
/* Address of beginning of regexp, or inside of last group. */
US_CHAR_TYPE *begalt;

/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
#ifdef MBS_SUPPORT
const US_CHAR_TYPE *beg_interval;
#else
const char *beg_interval;
#endif /* MBS_SUPPORT */

/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
Expand Down Expand Up @@ -3827,69 +3819,56 @@ regex_compile (pattern, size, syntax, bufp)

/* At least (most) this many matches must be made. */
int lower_bound = -1, upper_bound = -1;
beg_interval = p - 1;

/* Place in the uncompiled pattern (i.e., just after
the '{') to go back to if the interval is invalid. */
const CHAR_TYPE *beg_interval = p;

if (p == pend)
{
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_EBRACE);
}
goto invalid_interval;

GET_UNSIGNED_NUMBER (lower_bound);

if (c == ',')
{
GET_UNSIGNED_NUMBER (upper_bound);
if ((!(syntax & RE_NO_BK_BRACES) && c != '\\')
|| ((syntax & RE_NO_BK_BRACES) && c != '}'))
FREE_STACK_RETURN (REG_BADBR);

if (upper_bound < 0)
upper_bound = RE_DUP_MAX;
}
else
/* Interval such as `{1}' => match exactly once. */
upper_bound = lower_bound;

if (lower_bound < 0 || upper_bound > RE_DUP_MAX
|| lower_bound > upper_bound)
{
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_BADBR);
}
if (! (0 <= lower_bound && lower_bound <= upper_bound))
goto invalid_interval;

if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);

if (c != '\\' || p == pend)
goto invalid_interval;
PATFETCH (c);
}

if (c != '}')
{
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_BADBR);
}

/* We just parsed a valid interval. */
goto invalid_interval;

/* If it's invalid to have no preceding re. */
if (!laststart)
{
if (syntax & RE_CONTEXT_INVALID_OPS)
if (syntax & RE_CONTEXT_INVALID_OPS
&& !(syntax & RE_INVALID_INTERVAL_ORD))
FREE_STACK_RETURN (REG_BADRPT);
else if (syntax & RE_CONTEXT_INDEP_OPS)
laststart = b;
else
goto unfetch_interval;
}

/* We just parsed a valid interval. */

if (RE_DUP_MAX < upper_bound)
FREE_STACK_RETURN (REG_BADBR);

/* If the upper bound is zero, don't want to succeed at
all; jump from `laststart' to `b + 3', which will be
the end of the buffer after we insert the jump. */
Expand Down Expand Up @@ -3975,25 +3954,20 @@ regex_compile (pattern, size, syntax, bufp)
}
}
pending_exact = 0;
beg_interval = NULL;
}
break;

unfetch_interval:
/* If an invalid interval, match the characters as literals. */
assert (beg_interval);
p = beg_interval;
beg_interval = NULL;

/* normal_char and normal_backslash need `c'. */
PATFETCH (c);

if (!(syntax & RE_NO_BK_BRACES))
{
if (p > pattern && p[-1] == '\\')
goto normal_backslash;
}
goto normal_char;
break;

invalid_interval:
if (!(syntax & RE_INVALID_INTERVAL_ORD))
FREE_STACK_RETURN (p == pend ? REG_EBRACE : REG_BADBR);
unfetch_interval:
/* Match the characters as literals. */
p = beg_interval;
c = '{';
if (syntax & RE_NO_BK_BRACES)
goto normal_char;
else
goto normal_backslash;
}

#ifdef emacs
/* There is no way to specify the before_dot and after_dot
Expand Down
8 changes: 7 additions & 1 deletion posix/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ typedef unsigned long int reg_syntax_t;
this bit set, and it won't affect anything in the normal case. */
#define RE_DEBUG (RE_NO_GNU_OPS << 1)

/* If this bit is set, a syntactically invalid interval is treated as
a string of ordinary characters. For example, the ERE 'a{1' is
treated as 'a\{1'. */
#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)

/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
Expand Down Expand Up @@ -199,7 +204,8 @@ extern reg_syntax_t re_syntax_options;
| RE_NO_BK_VBAR)

#define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
| RE_INVALID_INTERVAL_ORD)

/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
Expand Down
26 changes: 15 additions & 11 deletions sysdeps/ia64/_mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@

#undef ret

.psr abi64
.psr lsb
.lsb

LEAF(_mcount)
alloc loc0 = ar.pfs, 4, 4, 3, 0
mov loc1 = rp
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
alloc loc1 = ar.pfs, 4, 4, 3, 0
mov loc0 = rp
.body
mov loc2 = r8 // gcc uses r8 to pass pointer to return structure
;;
mov loc3 = r15 // gcc uses r15 to pass the static link to nested functions
Expand All @@ -67,21 +65,27 @@ LEAF(_mcount)
.mii
mov gp = in1
mov r2 = ip
mov ar.pfs = loc0
mov ar.pfs = loc1
}
;;
adds r2 = 1f - .here, r2
mov b7 = loc1
adds r2 = _mcount_ret_helper - .here, r2
mov b7 = loc0
mov rp = in2
;;
mov r8 = loc2
mov r15 = loc3
mov b6 = r2
br.ret.sptk.few b6
END(_mcount)

1: alloc r2 = ar.pfs, 0, 0, 9, 0
LOCAL_LEAF(_mcount_ret_helper)
.prologue
.altrp b7
.save ar.pfs, r40
.body
alloc r2 = ar.pfs, 0, 0, 9, 0
mov ar.pfs = r40
br b7
END(_mcount)
END(_mcount_ret_helper)

weak_alias (_mcount, mcount)
22 changes: 8 additions & 14 deletions sysdeps/ia64/elf/start.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
Expand Down Expand Up @@ -31,14 +31,8 @@
* out6: stack_end
*/

.psr abi64
.psr lsb
.lsb

.text

.global _start#
.proc _start#
.global _start
.proc _start

_start:
{ .mlx
Expand All @@ -59,11 +53,11 @@ _start:
}
{ .mfi
mov ar.fpsr = r3
addl out0 = @ltoff(@fptr(main#)), gp
addl out0 = @ltoff(@fptr(main)), gp
}
{ .mfi
addl out4 = @ltoff(@fptr(_fini#)), gp
addl out3 = @ltoff(@fptr(_init#)), gp
addl out4 = @ltoff(@fptr(_fini)), gp
addl out3 = @ltoff(@fptr(_init)), gp
;;
}
{ .mmi
Expand All @@ -74,14 +68,14 @@ _start:
{ .mib
ld8 out4 = [out4] /* pointer to `fini' function descriptor */
mov out5 = ret0 /* dynamic linker destructor */
br.call.sptk.few rp = __libc_start_main#
br.call.sptk.few rp = __libc_start_main
}
{ .mib
mov rp = r0
br.ret.sptk.few rp /* break miserably if we ever return */
;;
}
.endp _start#
.endp _start

/* Define a symbol for the first piece of initialized data. */
.data
Expand Down
Loading

0 comments on commit 0a45b76

Please sign in to comment.