Commit Graph

35 Commits

Author SHA1 Message Date
Jakub Jelinek 58b3ebf2df re PR libmudflap/40778 (Mudflap instrumentation missing in cloned function.)
PR libmudflap/40778
	* tree-mudflap.c (mf_artificial): New function.
	(execute_mudflap_function_ops, execute_mudflap_function_decls,
	mx_register_decls, mudflap_enqueue_decl): Use it.

	* testsuite/libmudflap.c/fail68-frag.c: New test.

From-SVN: r183307
2012-01-19 19:58:02 +01:00
Tom de Vries 2a6dcb7e73 re PR middle-end/43513 (The stack pointer is adjusted twice)
2011-07-31  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/43513
	* testsuite/libmudflap.c/fail31-frag.c: Adapt testcase to prevent
	folding of alloca.

From-SVN: r176968
2011-07-31 10:02:12 +00:00
Rainer Orth 891a2e4259 re PR libmudflap/49550 (Many libmudflap tests fail on Solaris 11/x86)
gcc:
	PR libmudflap/49550
	* gcc.c (MFWRAP_SPEC): Also wrap mmap64.

	libmudflap:
	PR libmudflap/49550
	* mf-runtime.c (__wrap_main) [__sun__ && __svr4__]: Don't register
	stdin, stdout, stderr.
	Register __ctype, __ctype_mask.

	* configure.ac: Check for mmap64.
	Check for rawmemchr, stpcpy, mempcpy.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* mf-hooks1.c [HAVE_MMAP64] (__mf_0fn_mmap64): New function.
	(mmap64): New wrapper function.
	* mf-impl.h (__mf_dynamic_index) [HAVE_MMAP64]: Add dyn_mmap64.
	* mf-runtime.c (__mf_dynamic) [HAVE_MMAP64]: Handle mmap64.

	* mf-hooks2.c [HAVE_GETMNTENT && HAVE_SYS_MNTTAB_H]: Implement
	getmntent wrapper.

	* mf-hooks3.c (_REENTRANT): Define.

	* testsuite/libmudflap.c/heap-scalestress.c (SCALE): Reduce to 10000.

	* testsuite/libmudflap.c/pass-stratcliff.c: Include ../config.h.
	(MIN): Define.
	Use HAVE_RAWMEMCHR, HAVE_STPCPY, HAVE_MEMPCPY as guards.

	* testsuite/libmudflap.c/pass47-frag.c: Expect __ctype warning on
	*-*-solaris2.*.

From-SVN: r175961
2011-07-07 10:14:02 +00:00
Rainer Orth 0d72f628a4 re PR libmudflap/38738 (libmudflap could be enabled for Solaris when using GNU ld)
gcc:
	PR libmudflap/38738
	* config/sol2.h [!USE_GLD] (MFLIB_SPEC): Define.

	libmudflap:
	PR libmudflap/38738
	* configure.ac: Check for sys/mnttab.h.
	Check for library containing connect.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* mf-hooks2.c [HAVE_SYS_MNTTAB_H]: Include <sys/mnttab.h>.
	* testsuite/libmudflap.c/pass-stratcliff.c (main) [__sun__ &&
	__svr4__]: Disable rawmemchr, stpcpy, mempcpy tests.

From-SVN: r175537
2011-06-27 16:20:47 +00:00
Uros Bizjak 491fc0e191 pass46-frag.c (dg-options): Remove -Wall.
* testsuite/libmudflap.c/pass46-frag.c (dg-options): Remove -Wall.

From-SVN: r159453
2010-05-16 12:03:01 +02:00
David S. Miller 31b2eb0f1e pass54-frag.c: Add explicit return from main.
* testsuite/libmudflap.c/pass54-frag.c: Add explicit return from
	main.

From-SVN: r157472
2010-03-15 21:01:12 -07:00
Loren J. Rittle ab4daaf234 pass51-frag.c (MAP_FAILED): Define, if not in system header; use it.
2009-09-01  Loren J. Rittle  <ljrittle@acm.org>
	    Andreas Schwab  <schwab@linux-m68k.org>

	* testsuite/libmudflap.c/pass51-frag.c (MAP_FAILED): Define,
	if not in system header; use it.  On FreeBSD, must pass fd==-1
	with MAP_ANON flag.  Correct mmap error check.
	* testsuite/libmudflap.c/fail40-frag.c: Ditto.

Co-Authored-By: Andreas Schwab <schwab@linux-m68k.org>

From-SVN: r151277
2009-09-01 18:10:39 +00:00
Richard Guenther 14c41b9bb9 re PR tree-optimization/19831 (Missing DSE/malloc/free optimization)
2009-07-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/19831
	* tree-ssa-dce.c (propagate_necessity): Calls to functions
	that only act as barriers do not make any previous stores
	necessary.
	* tree-ssa-structalias.c (handle_lhs_call): Delay making
	HEAP variables global, do not add a constraint from nonlocal.
	(find_func_aliases): Handle escapes through return statements.
	(compute_points_to_sets): Make escaped HEAP variables global.

	* gcc.dg/tree-ssa/20041122-1.c: Enable TBAA, scan FRE dump,
	make allocated memory escape.  Un-XFAIL.
	* gcc.dg/vect/pr21591.c: Make allocated memory escape.
	* gcc.dg/vect/pr31699.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dce-7.c: New testcase.

	libmudflap/
	* testsuite/libmudflap.c/fail11-frag.c: Make allocated memory
	escape.
	* testsuite/libmudflap.c/fail12-frag.c: Likewise.
	* testsuite/libmudflap.c/fail16-frag.c: Likewise.
	* testsuite/libmudflap.c/fail31-frag.c: Likewise.

From-SVN: r149140
2009-07-01 12:27:33 +00:00
Ben Elliston 89da36ae12 re PR libmudflap/38462 (test libmudflap.c/fail27-frag.c fails output pattern test for ppc64)
PR libmudflap/38462
	* testsuite/libmudflap.c/fail27-frag.c: Match `mudflap dead
	object', not `mudflap object'.

From-SVN: r145328
2009-03-31 12:56:52 +11:00
Jakub Jelinek 959f8cd7da re PR middle-end/35314 (ICE with __builtin_setjmp and -fmudflap)
PR middle-end/35314
	* tree-mudflap.c (mf_build_check_statement_for): Split then_block
	after __mf_check call if the call must end a bb.

	* testsuite/libmudflap.c/pass67-frag.c: New test.

From-SVN: r141741
2008-11-10 14:48:06 +01:00
Jakub Jelinek 8586aeeb9c re PR libmudflap/36397 (ICE with pointer cast and -fmudflap)
PR libmudflap/36397
	* tree-mudflap.c (mf_xform_derefs_1): Handle VIEW_CONVERT_EXPR.

	* testsuite/libmudflap.c/pass64-frag.c: New test.

From-SVN: r140374
2008-09-15 23:52:53 +02:00
Volker Reichelt 7621f5d5fb common.opt (Wmudflap): New option.
* common.opt (Wmudflap): New option.
	* tree-mudflap.c (mf_xform_derefs_1): Guard warning by OPT_Wmudflap.
	(mx_register_decls): Likewise.
	(mudflap_finish_file): Likewise.
	* doc/invoke.texi: Document -Wno-mudflap.

	* testsuite/libmudflap.c/pass63-frag.c: New test.

From-SVN: r133385
2008-03-20 16:37:47 +00:00
Uros Bizjak 5114c2a320 fail8-frag.c: Adjust scan pattern for mudflap dead object.
* testsuite/libmudflap.c/fail8-frag.c: Adjust scan pattern for
        mudflap dead object.
        * testsuite/libmudflap.c/fail9-frag.c: Ditto.

From-SVN: r132557
2008-02-22 22:18:36 +01:00
Jakub Jelinek 58fcda212f re PR tree-optimization/34618 (ICE with -fmudflap and vectorization)
PR tree-optimization/34618
	* tree-outof-ssa.c (create_temp): Copy over DECL_GIMPLE_REG_P
	flag from T.

	* testsuite/libmudflap.c/pass62-frag.c: New test.

From-SVN: r131336
2008-01-05 13:06:54 +01:00
Janis Johnson 68d67107ef libmudflap.exp (libmudflap-init): Remove -static from MUDFLAP_FLAGS if static library not supported.
* testsuite/lib/libmudflap.exp (libmudflap-init): Remove -static from
	MUDFLAP_FLAGS if static library not supported.
	* testsuite/libmudflap.c/cfrags.exp (MUDFLAP_FLAGS): new.
	* testsuite/libmudflap.c/externs.exp: Ditto.
	* testsuite/libmudflap.c++/ctors.exp: Ditto.
	* testsuite/libmudflap.c++/c++frags.exp: Ditto.
	* testsuite/libmudflap.cth/cthfrags.exp: Ditto.

From-SVN: r107371
2005-11-22 20:35:51 +00:00
James E Wilson 2483ad581a Fix FreeBSD failure with recursive malloc call.
* mf-hooks1.c (malloc, calloc, realloc, free,
__mf_wrap_alloca_indirect): Call BEGIN_MALLOC_PROTECT before calling
the real routines, and END_MALLOC_PROTECT afterwards.
* mf-impl.h (enum __mf_state_enum): Expand comment.  Add in_malloc.
(BEGIN_PROTECT): Handle in_malloc state.
(BEGIN_MALLOC_PROTECT, END_MALLOC_PROTECT): New.
* testsuite/libmudflap.c/hook2-allocstuff.c: New.

From-SVN: r103256
2005-08-18 13:01:54 -07:00
Kelley Cook f9d09c4359 All files: Update FSF address.
2005-08-17  Kelley Cook  <kcook@gcc.gnu.org>

	* All files: Update FSF address.

From-SVN: r103197
2005-08-17 03:21:42 +00:00
Ulrich Weigand ad0a0295b5 * testsuite/libmudflap.c/externs-1.c (main): Add return statement.
From-SVN: r101184
2005-06-19 16:01:03 +00:00
Frank Ch. Eigler e1f4adc93b Fix for uncaching bug reported by Herman ten Brugge.
2005-06-15  Frank Ch. Eigler  <fche@redhat.com>

	Fix for uncaching bug reported by Herman ten Brugge.
	* mf-runtime.c (__mf_uncache_object): Search whole cache.
	* testsuite/libmudflap.c/fail40-frag.c: New test.

From-SVN: r100985
2005-06-15 16:15:40 +00:00
Frank Ch. Eigler 0ea49890a8 re PR libmudflap/21023 (mudflap reports errors for external array variable with no size specified)
2005-06-14  Frank Ch. Eigler  <fche@redhat.com>

	PR mudflap/21023
	* tree-mudflap.c (mudflap_finish_file): Exclude non-public
	rather than static objects (!) from libmudflap registration.

	* testsuite/libmudflap.c/externs.exp, externs-{1,2}.c: New test files.
	* testsuite/libmudflap.c/cfrags.exp: Bypass new sources.

From-SVN: r100950
2005-06-14 19:12:24 +00:00
Frank Ch. Eigler 0ee4e76d11 mf-runtime.c (__mfu_check): Respect ignore_reads configuration.
2005-03-17  Frank Ch. Eigler  <fche@redhat.com>

	* mf-runtime.c (__mfu_check): Respect ignore_reads configuration.
	* testsuite/libmudflap.c/{pass56,fail39}-frag.c: New tests.

From-SVN: r96620
2005-03-17 17:20:49 +00:00
Richard Henderson 130e4a02c2 * testsuite/libmudflap.c/pass32-frag.c: Fix typo.
From-SVN: r92930
2005-01-05 01:27:50 -08:00
Greg McGary 1330529e58 mf-impl.h (uintptr_t): Get typedef via stdint.h or define explicitly.
* mf-impl.h (uintptr_t): Get typedef via stdint.h or define explicitly.
	* mf-runtime.h: New file, replaces mf-runtime.h.in.
	* configure.ac (AC_CONFIG_FILES): mf-runtime.h is no longer generated.
	* Makefile.in: Ditto.
	* testsuite/lib/libmudflap.exp: Add -I${srcdir}/.. to get mf-runtime.h
	* testsuite/libmudflap.c/pass32-frag.c: s/uintptr_t/__mf_uintptr_t/
	* testsuite/libmudflap.c/fail36-frag.c: New test.
	* testsuite/libmudflap.c/fail37-frag.c: New test.
	* testsuite/libmudflap.c/fail38-frag.c: New test.

From-SVN: r92815
2005-01-02 22:24:50 +00:00
Frank Ch. Eigler 306ae32b68 fail35-,pass53-,pass54-frag.c: New tests.
2004-10-28  Frank Ch. Eigler  <fche@redhat.com>

	* testsuite/libmudflap.c/fail35-,pass53-,pass54-frag.c: New tests.
	* testsuite/libmudflap.c/pass35-frag.c: Correct embedded warning
	message.

From-SVN: r89783
2004-10-28 21:21:59 +00:00
Frank Ch. Eigler ddfabf89bb configure.ac: Check for more headers, functions.
2004-10-12  Frank Ch. Eigler  <fche@redhat.com>

	* configure.ac: Check for more headers, functions.
	* mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
	tracking overridden FILE buffers.
	(fopen, setvbuf): New/revised hook functions for buffer overriding.
	(setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
	(fflush): Accept given NULL stream (means "all streams").
	* mf-runtime.h.in:
	* mf-runtime.c (__mfu_check): Accept accesses that span adjacent
	HEAP/GUESS objects.
	(LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
	(__mf_adapt_cache): Use them all.
	* testsuite/libmudflap.c/pass35-frag.c: Update warning message.
	* testsuite/libmudflap.c++/ctors.exp: Ditto.
	* testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
	* configure, config.h.in: Regenerated.

From-SVN: r88996
2004-10-13 18:27:16 +00:00
Frank Ch. Eigler bf50d091ca * fixing typos in accidental checkin
From-SVN: r88463
2004-10-03 21:17:29 +00:00
Frank Ch. Eigler fefbfa2166 tree-mudflap.c (mf_build_check_statement_for): Reorganize to take check-base and -limit arguments.
2004-10-02  Frank Ch. Eigler  <fche@redhat.com>

	* tree-mudflap.c (mf_build_check_statement_for): Reorganize to
	take check-base and -limit arguments.
	(mf_xform_derefs_1): Reorganize slightly to pass proper base/limit
	check ranges for ARRAY_REF and COMPONENT_REF.
	(execute_mudflap_fnction_ops, ..._decls): Limit unnecessary
	instrumentation.

2004-10-02  Frank Ch. Eigler  <fche@redhat.com>

	* testsuite/libmudflap.c/pass50-frag.c, fail33-frag.c, fail34-frag.c:
	New tests for proper base/limit checking for aggregates.

From-SVN: r88432
2004-10-02 23:12:49 +00:00
Joseph Myers 971801fff6 attribs.c, [...]: Use %<, %> and %q for quoting in diagnostics going through pretty-print.c.
gcc:
	* attribs.c, builtins.c, c-format.c, c-pch.c, coverage.c,
	except.c, fold-const.c, function.c, langhooks.c, params.c,
	reload.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
	tree-dump.c, tree-mudflap.c, tree.c, varasm.c: Use %<, %> and %q
	for quoting in diagnostics going through pretty-print.c.  Use ''
	for quoting in other diagnostic text.
	* langhooks.c: Include intl.h.  Mark text locating diagnostics for
	translation.
	* Makefile.in (langhooks.o): Update dependencies.
	* pretty-print.h (pp_printf): Mark as accepting GCC diagnostic
	formats.

gcc/testsuite:
	* g++.dg/ext/member-attr.C, g++.dg/warn/deprecated.C,
	gcc.dg/deprecated.c, gcc.dg/noreturn-1.c, gcc.dg/noreturn-4.c:
	Update expected messages.

libmudflap:
	* testsuite/libmudflap.c/pass35-frag.c: Update expected message.

From-SVN: r87563
2004-09-15 21:48:10 +01:00
Frank Ch. Eigler 66a5d3b1c1 configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
2004-09-07  Frank Ch. Eigler  <fche@redhat.com>

	* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
	* mf-hooks2.c (strerror): Unregister previous string returned by
	previous strerror.
	(getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
	(getservent,getservbyname,getservbyport,gai_strerror): Ditto.
	* mf-runtime.h.in: Add redefine_extname pragmas for them all.
	* mf-runtime.c (__mf_describe_object): Clarify object life status.
	* testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
	New tests.
	* configure, config.h.in: Regenerated.

From-SVN: r87160
2004-09-07 21:52:52 +00:00
Frank Ch. Eigler 00dcddaaa0 ANSI C conversion, libmudflap specialization, recursion limiting.
2004-07-08  Frank Ch. Eigler  <fche@redhat.com>

	ANSI C conversion, libmudflap specialization, recursion limiting.
	* splay-tree.h (splay_tree_{de,}allocate_fn): Remove allocation_data
	argument and indirection function pointers, update callers.
	(splay_tree_s): Add statistics and recursion control fields
	num_keys, max_depth, depth, rebalance_p.
	* splay-tree.c (splay_tree_splay_helper): Track recursion depth.
	Back out of search if it exceeds limit.
	(splay_tree_splay): Manage recursion limiting with rebalancing as
	needed.
	(splay_tree_new): More initialization.
	(splay_tree_rebalance): New function.
	(splay_tree_foreach): Rewrite using nonrecursive logic.
	(splay_tree_xmalloc_allocate, splay_tree_xmalloc_deallocate):
	Remove.  Point indirect calls to mf-runtime.c's routines.
	(splay_tree_compare_ints, splay_tree_compare_pointers): Remove unused
	functions.
	(splay_tree_delete, splay_tree_delete_helper): Ditto.
	* testsuite/heap-scalestress.c: New test based on one from
	Eyal Lebedinsky <eyal@eyal.emu.id.au>:

From-SVN: r84303
2004-07-08 19:11:44 +00:00
Frank Ch. Eigler cfbd22d765 Adopt splay trees for object database.
2004-06-24  Frank Ch. Eigler  <fche@redhat.com>

	Adopt splay trees for object database.
	* Makefile.am: Copy splay-tree.* from libiberty.
	* Makefile.in, testsuite/Makefile.in: Regenerated.
	* mf-runtime.h.in (__mf_unregister): Add third parameter (type).
	* mf-hooks[123].c (*): Add new third parameter to mf_unregister.
	* mf-impl.h (BEGIN_PROTECT): Remove some trace text.
	* mf-runtime.c: Rewrite code dealing with object database to use
	libiberty splay trees.  Remove tree liveness aging option.
	* testsuite/libmudflap.c/fail18-frag.c: Add volatile flag.

From-SVN: r83611
2004-06-24 21:12:18 +00:00
Frank Ch. Eigler dc88d66f1a ctype support.
2004-06-09  Frank Ch. Eigler  <fche@redhat.com>

	ctype support.
	* configure.in: Look for ctype header and glibc implementation.
	* mf-hooks2.c (__ctype_{b,toupper,tolower}_loc): Sample ctype
	array hooks for glibc 2.3.
	* mf-runtime.h.in: Wrap them.
	* mf-runtime.c (__mf_init): Leave marker regarding other ctype
	implementations.
	* testsuite/libmudflap.c/pass47-frag.c: New test.
	* configure, config.h.in: Regenerated.

From-SVN: r82848
2004-06-09 19:04:56 +00:00
Frank Ch. Eigler 7954e85c00 Portability improvements, e.g., libmudflap/15293.
2004-06-04  Frank Ch. Eigler  <fche@redhat.com>

	Portability improvements, e.g., libmudflap/15293.
	* configure.in: Look for glibc extension functions.  Look for
	support of -f{function,data}-sections.  Look for more headers.
	Create testsuite/mfconfig.exp.  Correct more "test x.." thinkos.
	* Makefile.am: Use $(SECTION_FLAGS).  Collapse piecemeal-compiled
	mf-hooks* into usual single object per source.
	* mf-hooks*.c: Remove all #if WRAP_foo conditionals.
	* mf-hooks2.c: #include a bunch more system headers.  Define strnlen
	if system doesn't provide one.
	* mf-hooks3.c (struct pthread_info): Add stack_*_alloc fields.
	(pthread_create): Use it to properly GC dead thread stacks.
	* mf-runtime.c (__mf_violation): Correct snprintf type warning.
	* testsuite/Makefile.am: Stop generating site.exp.
	* testsuite/mfconfig.exp.in: New file.
	* testsuite/config/default.exp: Load new mfconfig.exp.
	* testsuite/lib/libmudflap.exp (libmudflap-init): Add extra libraries.
	(prune_gcc_output): Add glibc static linking warnings.
	* testsuite/libmudflap.*/*frags.exp: Enumerate needed -lmudflap* libs.
	* testsuite/libmudflap.c/pass46-frag.c: Ditto.
	* configure, Makefile, aclocal.m4, config.h.in, testsuite/Makefile.in:
	Regenerated with autoconf 2.57 and automake 1.7.

From-SVN: r82632
2004-06-04 20:12:01 +00:00
Frank Ch. Eigler 9193542205 libmudflap.exp (libmudflap-init): For C++ test cases only...
2004-05-17  Frank Ch. Eigler  <fche@redhat.com>

	* lib/libmudflap.exp (libmudflap-init): For C++ test cases only,
	import some build settings from libstdc++-v3 testsuite_flags.
	* .../cfrags.exp, .../c++frags.exp, .../cthfrags.exp: Corresponding
	changes to pass test language.

	* mf-runtime.c (__mfu_check): Poison the cache with antidote for
	quicker mode-nop handling.

From-SVN: r81944
2004-05-17 20:34:19 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00