aboutsummaryrefslogtreecommitdiff
path: root/gas/expr.c
AgeCommit message (Collapse)AuthorFilesLines
2009-04-20gas/Jan Beulich1-7/+104
2009-04-20 Jan Beulich <jbeulich@novell.com> * expr.c (operand): Call md_need_index_operator() and md_operator() if defined. Add unary label. (operator): Call md_operator() if defined. (expr): Adjust assertions on range and rank of op_left and op_right. Don't abort on unhandled operators when reducing expressions with both operands being constant. (expr_set_rank): New. * expr.h (expr_set_rank): Declare.
2009-04-16gas/Jan Beulich1-0/+15
2009-04-16 Jan Beulich <jbeulich@novell.com> * expr.c: Include limits.h if available, and #define CHAR_BITS otherwise. (expr): Check range of shift count when evaluating a constant expression.
2007-10-19Add MN10300 linker relaxation support for symbol differencesNick Clifton1-0/+3
2007-09-26gas/Jan Beulich1-4/+12
2007-09-26 Jan Beulich <jbeulich@novell.com> * config/tc-i386.h (md_register_arithmetic): Define. * config/tc-ia64.h (md_register_arithmetic): Likewise. * doc/internals.texi: Document md_register_arithmetic. * expr.c (make_expr_symbol): Force O_register expressions into reg_section. (expr): Provide default for md_register_arithmetic. Don't resolve adding/subtracting constants to/from registers if md_register_arithmetic is zero.
2007-07-03Switch to GPLv3Nick Clifton1-1/+1
2007-04-21gas/Alan Modra1-2/+2
* expr.c (expr): Assert on rankarg, not rank which can be unsigned. * read.c (read_a_source_file): Remove buffer_limit[-1] assertion. Don't skip over NUL char. (pseudo_set): Set X_op for registers to O_register. * symbols.c (symbol_clone): Remove assertion that sym is defined. (resolve_symbol_value): Resolve O_register symbols. * config/tc-i386.c (parse_real_register): Don't use i386_float_regtab. Instead find st(0) by hash lookup. * config/tc-ppc.c (ppc_macro): Warning fix. opcodes/ * i386-opc.c (i386_float_regtab, i386_float_regtab_size): Delete. Move contents to.. (i386_regtab): ..here. * i386-opc.h (i386_float_regtab, i386_float_regtab_size): Delete.
2006-10-24 * expr.c (expr): Replace O_add case in switch (op_left) explainingBen Elliston1-1/+3
why it can never occur.
2006-06-07remove some duplicate #include's.Alan Modra1-1/+0
2006-05-09 * expr.c (operand): Remove `if (0 && ..)' statement andBen Elliston1-11/+1
subsequently unused target_op label. Collapse `if (1 || ..)' statement. * app.c (do_scrub_chars): Remove unused case 0, as it is handled separately above the switch.
2006-04-04 PR 997Alan Modra1-5/+13
* frags.c (frag_offset_fixed_p): New function. * frags.h (frag_offset_fixed_p): Declare. * expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction. (resolve_expression): Likewise.
2005-12-22gas/Jan Beulich1-14/+78
2005-12-22 Jan Beulich <jbeulich@novell.com> * symbols.h (snapshot_symbol): First parameter is now pointer to pointer to symbolS. * symbols.c (snapshot_symbol): Likewise. Store resulting symbol there. Use symbol_equated_p. * expr.c (resolve_expression): Change first argument to snapshot_symbol. Track possibly changed add_symbol consistently across function. Resolve more special cases with known result. Also update final_val when replacing add_symbol. gas/testsuite/ 2005-12-22 Jan Beulich <jbeulich@novell.com> * gas/all/cond.s: Also check .if works on equates to undefined when the expression value can be known without knowing the value of the symbol. * gas/all/cond.l: Adjust. * gas/i386/equ.s: Also check .if works on (equates to) registers when the expression value can be known without knowing the value of the register. * gas/i386/equ.e: Adjust.
2005-11-08* expr.c (operand <case '$'>): Use DOLLAR_AMBIGU rather than flag_mri_m68kNick Clifton1-3/+3
as condition for parsing the '$' as a prefix. * as.h (DOLLAR_AMBIGU): Define if needed.
2005-11-07 * expr.c (op_encoding): Map '=' to O_SINGLE_EQ, if defined.Alan Modra1-1/+4
* config/tc-z80.h: Define O_SINGLE_EQ as O_eq.
2005-11-06 * expr.c (integer_constant): Match only 'B' as binary suffix ifAlan Modra1-1/+4
NUMBERS_WITH_SUFFIX and LOCAL_LABELS_FB. Allow both 'b' and 'B' otherwise.
2005-10-11This adjusts equate handling byNick Clifton1-11/+211
- allowing true forward references (which will always assume the referenced symbols have at the point of use) through the new .eqv pseudo-op and the new == operator - disallowing changing .equiv-generated equates (so that the protection this provides is both forward and backward) - snapshotting equates when their value gets changed so that previous uses don't get affected by the new value. - allowing expressions in places where absolute expressions (or register names) are needed which were not completely resolvable at the point of their definition but which are fully resolvable at the point of use In addition it fixes PR/288.
2005-10-10* expr.c (operator): Allow "!=" as a synonym for "<>".Nick Clifton1-4/+10
* doc/as.texinfo (Infix Op): Mention "!=".
2005-05-05Update the address and phone number of the FSFNick Clifton1-2/+2
2005-04-29 * Makefile.am (GAS_CFILES): Remove bignum-copy.c.Ben Elliston1-29/+0
(GENERIC_OBJS): Likewise, remove bignum-copy.o. (bignum-copy.o): Remove. * Makefile.in: Regenerate. * makefile.vms (OBJS): Remove bignum-copy.obj. * symbols.h (local_symbol_make): Remove declaration. (verify_symbol_chain_2): Likewise. * symbols.c (local_symbol_make): Make static. (max_indent_level): Likewise. (verify_symbol_chain_2): Remove. * macro.c (macro_hash): Make static. * messages.c (fprint_value): Remove. * read.h (get_absolute_expr): Remove. (emit_leb128_expr): Likewise. (do_s_func): Likewise. * read.c (do_s_func): Make static. (emit_leb128_expr): Likewise. (get_absolute_expr): Likewise. * as.h (as_howmuch): Remove declaration. (fprint_value): Likewise. * as.c (myname): Make static. * input-scrub.c (as_howmuch): Remove. (as_1_char): Likewise. * input-file.h (input_file_is_open): Remove. * input-file.c (input_file_is_open): Likewise. * expr.h (expr_build_unary): Remove declaration. (expr_build_binary): Likewise. * expr.c (expr_build_unary): Remove. (expr_build_binary): Likewise. * hash.h (hash_replace): Remove declaration. (hash_delete): Likewise. * hash.c (hash_replace): Remove. (hash_delete): Likewise. * bignum-copy.c (bignum_copy): Move from here .. * config/tc-vax.c (bignum_copy): .. to here. * bignum.h (LOG_TO_BASE_2_OF_10): Remove. (bignum_copy): Remove extern declaration. * sb.h (string_count): Remove extern declaration. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * sb.c (dsize): Replace preprocessor macro with static int. (string_count): Make static. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * config/obj-coff.c (dim_index): Make static. * config/tc-i386.c (GOT_symbol): Likewise. (output_invalid_buf): Likewise. * doc/internals.texi (Warning and error messages): Remove the prototype for fprint_value.
2005-03-15gas/Jan Beulich1-19/+15
2005-03-15 Jan Beulich <jbeulich@novell.com> * expr.c (operand): Merge handling of unary + into that for unary -, !, and ~.
2005-03-03Remove redundant code enclosed by #ifdef RELAX_PAREN_GROUPING....#endif.Nick Clifton1-6/+1
2005-03-01 * expr.c (integer_constant): Remove TARGET_WORD_SIZE hack.Alan Modra1-5/+1
* config/tc-m68k.h (TARGET_WORD_SIZE): Delete.
2005-03-01 * as.h (assert): Warning fix.Alan Modra1-1/+1
* expr.c (expr): Correct assertion. * read.c (s_comm_internal): Remove assertion. * write.c (relax_segment): Enable vma assertion only for BFD_ASSEMBLER. (fixup_segment): Remove assertion. * config/tc-dlx.c (machine_ip): Remove untrue assertions. (md_apply_fix3): Likewise. * config/tc-i370.c (md_begin): Correct assertion. (i370_macro): Warning fix for assertion.
2004-08-11 * expr.c (operand): Handle the "~", "-", and "!" operators appliedMark Mitchell1-0/+29
to bignums. * gas/arm/bignum1.s: New test. * gas/arm/arm.exp: Run it.
2004-05-23 * expr.c (operand, operator): Don't reject '++' and '--'.Alan Modra1-6/+9
2004-04-16 * expr.c (operand): Correct checks for ++ and --.Alan Modra1-2/+2
2004-03-18 * expr.c (operand): Reject ++ and --.Nathan Sidwell1-0/+15
(operator): Likewise.
2003-11-22 * ehopt.c: Convert to ISO-C.Kazu Hirata1-49/+30
* emul.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * flonum-copy.c: Likewise. * flonum-mult.c: Likewise. * flonum.h: Likewise. * frags.c: Likewise. * frags.h: Likewise.
2003-05-27 * expr.c (make_expr_symbol): Fold FAKE_LABEL_NAME use into theRichard Henderson1-10/+2
symbol_create call. (current_location): Use symbol_temp_new_now. * stabs.c (s_stab_generic): Use symbol_temp_new. * symbols.c (temp_label_name): Remove. (symbol_temp_new, symbol_temp_make): Use FAKE_LABEL_NAME.
2002-10-18 * expr.c (operand): Add support for n.nn flonums.Alan Modra1-16/+28
2002-09-20 * expr.c (expr): Simplify foo-foo here.Alan Modra1-18/+2
(clean_up_expression): Remove O_subtract code.
2002-09-19 * write.h (struct fix): Add fx_dot_value.Alan Modra1-0/+4
(dot_value): Declare. * write.c (dot_value): New var. (fix_new_internal): Save dot_value as fx_dot_value. * expr.c (expr): Update dot_value.
2002-08-27 * dwarf2dbg.c: Always include dwarf2dbg.h.Alan Modra1-4/+2
(dwarf2_directive_file): Adjust dummy version args. * ecoff.c (ecoff_directive_weakext): Add ATTRIBUTE_UNUSED. * expr.c (clean_up_expression <O_subtract>): Allow subtraction when symbol values differ. * read.c (do_align): Add ATTRIBUTE_UNUSED to label. (pseudo_set <O_subtract>): Remove unnecessary segment test. * config/obj-bout.c (obj_pseudo_table): Warning fix.
2002-05-18 * app.c: Fix formatting.Kazu Hirata1-1/+1
* as.c: Likewise. * ehopt.c: Likewise. * expr.c: Likewise. * input-file.c: Likewise. * listing.c: Likewise. * macro.h: Likewise. * stabs.c: Likewise. * symbols.c: Likewise.
2001-10-11 * app.c: Fix comment typos.Kazu Hirata1-3/+3
* bit_fix.h: Likewise. * expr.c: Likewise. * itbl-ops.c: Likewise.
2001-09-19Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu1-10/+5
2001-09-09 * expr.c (expr): Move code setting "retval" to the end of the loop,Alan Modra1-18/+24
and rearrange for efficiency. For "PIC code" subtraction, use "rightseg" rather than recalculating. For "symbol OP symbol" subtract, set "retval" to absolute_section if symbols in same section. * symbols.c (resolve_symbol_value): Resolve "sym +/- expr" to an O_symbol. Simplify a +/- b code. Allow equality and non-equality comparisons on symbols from any section. Allow other comparison operators as for subtraction. (symbol_equated_reloc_p): New predicate function. * symbols.h (symbol_equated_reloc_p): Declare. * write.c (adjust_reloc_syms): Use symbol_equated_reloc_p. (write_relocs): Likewise. (write_object_file): Likewise. (relax_segment <rs_machine_dependent>): Ensure segment for expression syms is set correctly. * config/tc-mips.c (md_estimate_size_before_relax): Likewise. * config/tc-i386.c (md_assemble <Output jumps>): Don't lose part of a complex expression when setting up frag_var.
2001-08-142001-08-14 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston1-0/+3
* expr.c (operand)[LITERAL_PREFIXDOLLAR_HEX]: Treat $L as a label, not a hex constant. This patch was approved by Nick Clifton.
2001-08-01 * read.c: Standardize error/warning messages - don't capitalise, noAlan Modra1-10/+11
final period or newline, don't say "ignored" or "zero assumed" for as_bad messages. In some cases, change the wording to that used elsewhere for similar messages. * app.c, as.c, atof-generic.c, cgen.c, cond.c, depend.c, dwarf2dbg.c, ecoff.c, expr.c, frags.c, input-file.c, input-scrub.c, listing.c, output-file.c, stabs.c, subsegs.c, symbols.c, write.c: Likewise. * ecoff.c (ecoff_directive_end): Test for missing name by comparing input line pointers rather than reading string. (ecoff_directive_ent): Likewise. * read.c (s_set): Likewise. (s_align): Report a warning rather than an error for alignment too large. (s_comm): Check for missing symbol name. (s_lcomm_internal): Likewise. (s_lsym): Likewise. (s_globl): Use is_end_of_line instead of looking for '\n'. (s_lcomm_internal): Likewise. (ignore_rest_of_line): Report a warning rather than an error.
2001-06-13Fix typo in commentNick Clifton1-1/+1
2001-05-25Revert last patch.Alan Modra1-13/+0
2001-05-25 * expr.c (expr): Set return value to absolute_section forAlan Modra1-0/+13
subtractive operations on symbols within a segment. * read.c (pseudo_set): Set segment for complex expressions.
2001-05-22 * symbols.c (resolve_symbol_value): Remove "finalize" param,Alan Modra1-1/+1
instead use finalize_syms directly. Don't treat expressions specially with regard to finalize_syms. Update calls to self. (resolve_local_symbol): Update call to resolve_symbol_value. (S_GET_VALUE): Likewise. Return resolve_symbol_value if !finalize_syms. * symbols.h (resolve_symbol_value): Update prototype. * config/obj-aout.c (obj_crawl_symbol_chain): Update call to resolve_symbol_value. * config/obj-bout.c (obj_crawl_symbol_chain): Likewise. * config/obj-coff.c (do_relocs_for): Likewise. (yank_symbols): Likewise. (fixup_segment): Likewise. * config/obj-vms.c (obj_crawl_symbol_chain): Likewise. * config/tc-mips.c (md_convert_frag): Likewise. * config/tc-ppc.c (ppc_frob_symbol): Likewise. (ppc_fix_adjustable): Likewise. * dwarf2dbg.c (dwarf2dbg_estimate_size_before_relax): Likewise. (dwarf2dbg_convert_frag): Likewise. * ehopt.c (eh_frame_estimate_size_before_relax): Likewise. (eh_frame_convert_frag): Likewise. * expr.c (make_expr_symbol): Likewise. * write.c (adjust_reloc_syms): Likewise. (write_object_file): Likewise. (relax_segment): Likewise. (fixup_segment): Likewise. (finalize_syms): Init to zero, and update comment. (write_object_file): Set finalize_syms to 1 rather than 2. * doc/internals.texi (sy_value): Mention finalize_syms. (S_GET_VALUE): Remove restriction on when S_GET_VALUE can be called.
2001-04-12* expr.c (operand): Pass &c to md_parse_name().Alexandre Oliva1-1/+1
* config/tc-ia64.h, config/tc-ppc.h, config/tc-tic54x.h: Adjust.
2001-03-30Pass finalize_syms on calls to resolve_symbol_value.Alan Modra1-1/+1
2001-03-08Fix copyright noticesNick Clifton1-1/+2
2001-02-13Update copyright date.Alan Modra1-1/+1
2001-02-13Fix parsing of multi-char operators.Alan Modra1-14/+17
2000-11-28Correct {STANDARD,MRI}_MUL_PRECEDENCE value.Alan Modra1-3/+3
2000-10-302000-10-30 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-3/+2
* expr.c: Fix formatting. * flonum-copy.c: Likewise. * flonum.h: Likewise. * gasp.c: Likewise. * hash.c: Likewise.
2000-10-172000-10-17 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-6/+4
* debug.c: Fix formatting. * depend.c: Likewise. * dwarf2dbg.c: Likewise. * dwarf2dbg.h: Likewise. * ecoff.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * flonum-konst.c: Likewise. * frags.h: Likewise.